space2underscore 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -13
- data/bin/space2underscore +0 -2
- data/lib/space2underscore.rb +9 -3
- data/lib/space2underscore/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8e7442b6358f4bb2fc54e592a4197266541618b
|
4
|
+
data.tar.gz: badb4e88737c2d1558e17f7a9cf0a6665f7da8c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d7f099abbc3f07e4d2255853cd35820f6348524d279b2cfd014efb23c99e576c1b31ed61aa4b6c9b6cb66ca2eda9974c8c6843f44038cb0c74976231f38fbc2
|
7
|
+
data.tar.gz: 0a6aff6aa29cb919cdf62f69f2f54b26a4006d20e63a293d9c625c2878da77ab18c1f74be317086e02b89b26aa7fa5ee7d44ccc1a2ba34ad622d60818aaa7c49
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Space2underscore
|
2
|
-
## What
|
2
|
+
## What is space2underscore
|
3
3
|
Change the space into underscore.
|
4
4
|
|
5
|
+
space2underscore is a useful command when you want to check out a branch.
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
@@ -28,17 +30,10 @@ If your computer is CentOS then
|
|
28
30
|
|
29
31
|
From the terminal:
|
30
32
|
|
31
|
-
$ space2underscore
|
32
|
-
=>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-

|
37
|
-
|
38
|
-
From the terminal:
|
39
|
-
|
40
|
-
$ space2underscore add stock function to user feed # underscore included branch name is copied to clipboard
|
41
|
-
$ git checkout -b add_stock_function_to_user_feed # paste
|
33
|
+
$ space2underscore new branch
|
34
|
+
=> Do you create the new branch? [y/Y] # y
|
35
|
+
=> Switched to the new branch 'new_branch’
|
36
|
+
=> Branch has been created.
|
42
37
|
|
43
38
|
## Contributing
|
44
39
|
|
@@ -47,4 +42,3 @@ From the terminal:
|
|
47
42
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
48
43
|
4. Push to the branch (`git push origin my-new-feature`)
|
49
44
|
5. Create new Pull Request
|
50
|
-
|
data/bin/space2underscore
CHANGED
data/lib/space2underscore.rb
CHANGED
@@ -10,6 +10,10 @@ module Space2underscore
|
|
10
10
|
"echo #{underscore_include_sentence} | ruby -pe 'chomp' | #{copy_cmd}"
|
11
11
|
end
|
12
12
|
|
13
|
+
def execute_command(command)
|
14
|
+
system command
|
15
|
+
end
|
16
|
+
|
13
17
|
def copy_cmd
|
14
18
|
if system("type pbcopy > /dev/null 2>&1")
|
15
19
|
"pbcopy"
|
@@ -20,14 +24,16 @@ module Space2underscore
|
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
23
|
-
def create_new_branch(
|
27
|
+
def create_new_branch(underscore_include_sentence)
|
24
28
|
print "Do you create the new branch? [y/Y]"
|
25
29
|
flag = $stdin.gets.chomp
|
26
30
|
|
27
|
-
if flag
|
28
|
-
system "git checkout -b #{
|
31
|
+
if !!(flag =~ /^y(es)?$/i) || flag == ''
|
32
|
+
system "git checkout -b #{underscore_include_sentence}"
|
29
33
|
"Branch has been created."
|
30
34
|
else
|
35
|
+
execute_command(generate_command(underscore_include_sentence))
|
36
|
+
|
31
37
|
"Branch name has been copied to clipboard."
|
32
38
|
end
|
33
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: space2underscore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sachin21
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|