Tutorial on creating a custom Ruby gem package, rubygem
Write a simple example
1. Create the following folder
Note: The lib directory must have a rb file with the same name as your gem.
Copy codeThe Code is as follows:$ Cd hola$ Tree.├ ── Hola. gemspec── Lib└ ── Hola. rb
2. write code
. Hola. rb
% cat lib/hola.rb class Hola def self.hi puts "Hello world!" end end
. Hola. gemspec
% cat ho
Javascript implements switching between values in td, and javascript switches to td
I encountered an interview question before the interview. I didn't answer it because I had no thoughts at the time. Today I sorted it out and shared it with you:
The original question is: using the object method to create a 2x2 table requires a button in the cell column 2 in the second row. When you click this button, the va
Customer requirements are paramount.
This is the changed code. The "OK" and "cancel" buttons are removed. Click to double-click the event, and Press ESC to cancel the change.
Copy codeThe Code is as follows: // Add a double-click event for each Td
Function ReWritable ()
{
Var tbmian = document. getElementById ("tbmain ");
// Cyclically, double-click events are added for each column of each row. However, the first row (thead) and the last row (tfoot) a
Today, I encountered a very shameful thing during development: I removed the nbsp; that was written by others. I think there are a lot of confusions, and the results were scolded by the great gods. Removing this nbsp; will lead to the problem that the border of the TD will not be displayed when there is no data between TD, so the painful lesson is to be self-reported.Note: There is no content between
Lt; tr gt; lt; td gt; test lt; td gt; lt; tr gt; replace it with lt; LI gt; test lt; LI gt; for PHP regular expression Replacement. thank you. Example:
TestTo replace
TestPlease replace the PHP regular expression. thank you.
Because my HTML code is as follows:
News 1
2014-03-12
News 2
2014-02-20
The Charm Clan MX5 cracked unicom/Mobile 4g/3g (TD-LTE/TD-SCDMA/FDD-LTE/WCDMA)
Prerequisite: To ensure adequate electricity, at least 50%. Use pea pods, application treasure, etc. to back up important information.
1, download MX5 General edition firmware (http://www.flyme.cn/firmware.html)
2, after downloading, the handset and the computer through the data line connection.
Hint: The screenshot b
Customer demand is paramount.
This is the changed code, remove the "OK", "Cancel" button. Click to double-click the event, the user presses the ESC key to cancel the change.
Copy Code code as follows:
Add a double click event for each TD
function rewritable ()
{
var Tbmian=document.getelementbyid ("Tbmain");
Loops, adding a double click event for each row of columns, but the first row (THEAD) is not added to the last row (TFOOT).
for
want to view the help of the install command separately, you can use the NPM helper install--------------------------------------------------------------------------------------------------------Gem-v #gem版本Gem Update #更新所有包Gem Update--system #更新RubyGems软件Gem install Rake #
This is the changed code to implement the following functions: Remove "OK" and "cancel. Click to double-click the event, and Press ESC to cancel the change. If you are interested, you can understand the customer requirements first.
This is the changed code. The "OK" and "cancel" buttons are removed. Click to double-click the event, and Press ESC to cancel the change.
The Code is as follows:
// Add a double-click event for each TdFunction ReWritable (){Var tbmian = document. getElementById ("t
FunctionExcutelink (OBJ ){VaRTable = obj. parentnode. parentnode;//Get table from TDVaRScenename = table. Rows [0]. cells [1]. childnodes [0]. value;//Obtains the value of a TD in a table.If(Scenename. Trim () = "") {Alert ("Enter the scenario name");Return;}VaRLon =Top. objearth. globeobserver ;}
// Table structure
Note: obj. parentnode. Parentnode. parentnode. parentnode directly obtains the table object. You can call all the attributes and me
The following small series will bring you a solution where the border style of the lt; td gt; label cannot be displayed in the browser. I think this is quite good. I will share it with you and give you a reference.
Problem:
In some browsers, such as the compatibility mode of the 360 browser,
When the content in the label is empty, that is, her style border is invalid.
Solution:
The solution that the border style of the above label cannot be
there. Else T, as it turns out, thereIsSomething out there: it's called the graphics execution manager, or gem. the intel-sored gem project is all of one month old, as of this writing. the gem developers had not really intended to announce their work quite yet, but the TTM discussion brought the issue to the fore.
Keith Packard's introduction to gemshortdes a do
Ruby-v #查看ruby version ruby-e ' require ' watir; Puts Watir::ie::version ' #查看watir版本
RVM list Known #列出已知的ruby版本
RVM Install 1.9.3
RVM Use 1.9.3 | RVM Use System
RVM Use 1.9.3--default
RVM List #列出本地ruby版本
RVM Remove 1.9.2
See RVM Practical Guide for specific details https://ruby-china.org/wiki/rvm-guide
Gem-v #gem版本
Gem Source #
Magic Gem House system development, Magic Gem House source code development, Magic Gem House Consulting: 185,2946,0381 Mr. Chen (micro-electric), Magic Gem House mode development, Magic Gem House app development, Magic Gem House P
Environment: OSX EI 10.11.1After switching to the gem source yesterday, there was no problem with the pod installation, or it could be used$ gem Sources--add https://ruby.taobao.org/--remove https://rubygems.org/$ sudo gem install CocoapodsToday when the use of the time, under a project to execute pod install half a day or so no response, but the CTRL + C forced
Common Ruby Package Manager gem commands and common rubygem commands
Gem-related commands
1. display the help and version of gemCopy codeThe Code is as follows:Gem-h/-- help# Display the help of gem
Gem-v/-- version# Display the gem version number2. List all available softwa
The following error is always reported when you install the gem.
WARNING: RubyGems 1.2 + index not found:
RubyGems will revert to legacy indexes degrading performance.
Or the gem install is too slow or cannot be connected to timeout.
You can install gem locally.
First go to the gem official website http://rubygems.org/
Create your own gem and upload it to githubCreate your own gem and upload it to the github environment: centos7, git version 1.8.3.11. Create gem1 to install bundler# Gem install bundler2. Use bundler to create the framework required for gem# Bundler gem file_manipulate3. Mo
In my previous blog post, I documented how Ruby operates the environment configuration of the MongoDB database in a Windows environment. The last step describes the driver package for installing MongoDB. Using the Gem Online installation method. The purpose of this article is to use GEMS for offline installation of GEM kits when the target machine or environment cannot connect to the Internet.1. in the http
After installing Ror, you plan to run a demo.
Question 1,
$ Ruby script/Server
Rails requires rubygems> = 1.3.1 (You have 1.2.0). Please 'gem update -- system' and try again.
Question 2,
Execute as prompted:$ Sudo gem update -- SystemBut it prompts that the usage of -- system has been disabled:Error: While executing gem... (runtimeerror)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.