space2dash 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +17 -0
- data/README.md +23 -6
- data/Rakefile +4 -7
- data/bin/s2d +13 -0
- data/bin/space2dash +1 -1
- data/lib/space2dash.rb +5 -7
- data/lib/space2dash/version.rb +1 -1
- data/space2dash.gemspec +3 -3
- data/spec/space2dash_spec.rb +1 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f149f1905bdb1a0a37d90edb5b38184154598a04
|
4
|
+
data.tar.gz: f35cc8ef16241f5c35f85d391fc2c02147a4e162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19aa5eac5fe011b2745235debd0912155ee354c03ea5835209b43e5ba4d22f849d33171a32986e06a93406513daf930e838fb20f3f53cb212451ec87748d56c4
|
7
|
+
data.tar.gz: 157d61b609ff3a2b0ba25f718c347257f95b3b2c3f91c2ac8c8d248872493186d5072fa3cffe9219d261708cc87be7cfd47dc48deda41c7a6a85671b5b9b959d
|
data/.travis.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 2.1.2
|
5
|
+
- 2.1.1
|
6
|
+
- 2.1.0
|
7
|
+
- 1.9.3-p547
|
8
|
+
- 1.9.3-p392
|
9
|
+
- 1.9.3-p429
|
10
|
+
- 1.9.3-p448
|
11
|
+
- 1.9.3-p484
|
12
|
+
- 1.9.3-p545
|
13
|
+
|
14
|
+
script: "bundle exec rspec spec"
|
15
|
+
|
16
|
+
notifications:
|
17
|
+
slack: sachin21dev:PVRFTzXu4ovOOkZYJ6fCISbq
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Space2dash
|
1
|
+
# Space2dash [![Build Status](https://travis-ci.org/sachin21/space2dash.svg?branch=master)](https://travis-ci.org/sachin21/space2dash)
|
2
2
|
## What is space2dash
|
3
3
|
Change the space into dash.
|
4
4
|
space2dash is a useful command when you want to check out a branch.
|
@@ -9,15 +9,32 @@ Install it yourself as:
|
|
9
9
|
$ gem install space2dash
|
10
10
|
|
11
11
|
## Usage
|
12
|
-
|
13
12
|
From the terminal:
|
14
13
|
|
15
|
-
|
16
|
-
|
14
|
+
### 1. e.g. Create the new branch
|
15
|
+
|
16
|
+
```
|
17
|
+
$ space2dash new branch -c
|
18
|
+
=> Switched to the new branch 'new_branch’
|
19
|
+
```
|
20
|
+
|
21
|
+
Run with `--create` or `-c` options.
|
22
|
+
|
23
|
+
### 2. e.g. Rename the already created a branch
|
24
|
+
|
25
|
+
```
|
26
|
+
$ git branch -m $(space2dash renamed branch)
|
27
|
+
```
|
28
|
+
|
29
|
+
When option is nothing, space2dash has outputted to the standard output.
|
30
|
+
|
31
|
+
## Shorthand
|
17
32
|
|
18
|
-
|
33
|
+
A shorthand alias for space2dash can also be used.
|
19
34
|
|
20
|
-
|
35
|
+
```
|
36
|
+
s2d new branch
|
37
|
+
```
|
21
38
|
|
22
39
|
## Contributing
|
23
40
|
|
data/Rakefile
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
2
3
|
|
3
|
-
|
4
|
-
require 'rspec/core/rake_task'
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
5
|
|
6
|
-
|
7
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
8
|
-
t.rspec_opts = ['-c', '-fs']
|
9
|
-
end
|
6
|
+
task default: :spec
|
data/bin/s2d
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'space2dash'
|
3
|
+
|
4
|
+
CREATE_FLAGS = %w(-c --create)
|
5
|
+
|
6
|
+
args = ARGV.reject { |arg| CREATE_FLAGS.include?(arg) }
|
7
|
+
result = Space2dash.convert(args)
|
8
|
+
|
9
|
+
if ARGV.include?('-c') || ARGV.include?('--create')
|
10
|
+
print Space2dash.create_new_branch(result)
|
11
|
+
else
|
12
|
+
print result
|
13
|
+
end
|
data/bin/space2dash
CHANGED
@@ -4,7 +4,7 @@ require 'space2dash'
|
|
4
4
|
CREATE_FLAGS = %w(-c --create)
|
5
5
|
|
6
6
|
args = ARGV.reject { |arg| CREATE_FLAGS.include?(arg) }
|
7
|
-
result
|
7
|
+
result = Space2dash.convert(args)
|
8
8
|
|
9
9
|
if ARGV.include?('-c') || ARGV.include?('--create')
|
10
10
|
print Space2dash.create_new_branch(result)
|
data/lib/space2dash.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'space2dash/version'
|
2
2
|
|
3
3
|
module Space2dash
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
end
|
4
|
+
def self.convert(argv)
|
5
|
+
argv.length == 1 ? argv[0].strip.gsub(/\s/, '-') : argv.join('-')
|
6
|
+
end
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
end
|
8
|
+
def self.create_new_branch(dash_include_sentence)
|
9
|
+
system "git checkout -b #{dash_include_sentence}"
|
12
10
|
end
|
13
11
|
end
|
data/lib/space2dash/version.rb
CHANGED
data/space2dash.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Space2dash::VERSION
|
9
9
|
spec.authors = ['sachin21']
|
10
10
|
spec.email = ['sachin21.developer@gmail.com']
|
11
|
-
spec.description = '
|
12
|
-
spec.summary = '
|
11
|
+
spec.description = 'Change the space into dash'
|
12
|
+
spec.summary = 'Change the space into dash'
|
13
13
|
spec.homepage = 'http://github.com/sachin21/space2dash'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
|
35
35
|
Or
|
36
36
|
|
37
|
-
$ git branch -m $(space2dash renamed branch) #
|
37
|
+
$ git branch -m $(space2dash renamed branch) # space2dash has outputted to the standard output.
|
38
38
|
|
39
39
|
----------------------------------------------------------
|
40
40
|
..........................................................
|
data/spec/space2dash_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Space2dash do
|
4
|
-
it '
|
4
|
+
it 'returns dash included in string' do
|
5
5
|
expect(Space2dash.convert(['fuga hoge foo'])).to include('-') # String case
|
6
6
|
expect(Space2dash.convert(%w(fuga hoge foo))).to include('-') # Array case
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: space2dash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sachin21
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,20 +66,23 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description: Change the space into dash
|
70
70
|
email:
|
71
71
|
- sachin21.developer@gmail.com
|
72
72
|
executables:
|
73
|
+
- s2d
|
73
74
|
- space2dash
|
74
75
|
extensions: []
|
75
76
|
extra_rdoc_files: []
|
76
77
|
files:
|
77
78
|
- ".gitignore"
|
78
79
|
- ".rspec"
|
80
|
+
- ".travis.yml"
|
79
81
|
- Gemfile
|
80
82
|
- LICENSE.txt
|
81
83
|
- README.md
|
82
84
|
- Rakefile
|
85
|
+
- bin/s2d
|
83
86
|
- bin/space2dash
|
84
87
|
- lib/space2dash.rb
|
85
88
|
- lib/space2dash/version.rb
|
@@ -95,9 +98,9 @@ post_install_message: "\n ___________________________________________________
|
|
95
98
|
\ Thank you for installing space2dash.\n\n ************************* Usage
|
96
99
|
**************************\n\n From the terminal:\n\n $ space2dash new branch
|
97
100
|
-c\n => Switched to the new branch 'new-branch’\n\n Or\n\n $ git branch
|
98
|
-
-m $(space2dash renamed branch) #
|
99
|
-
\
|
100
|
-
\
|
101
|
+
-m $(space2dash renamed branch) # space2dash has outputted to the standard output.\n\n
|
102
|
+
\ ----------------------------------------------------------\n ..........................................................\n
|
103
|
+
\ __________________________________________________________\n "
|
101
104
|
rdoc_options: []
|
102
105
|
require_paths:
|
103
106
|
- lib
|
@@ -113,10 +116,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
116
|
version: '0'
|
114
117
|
requirements: []
|
115
118
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.4.5
|
117
120
|
signing_key:
|
118
121
|
specification_version: 4
|
119
|
-
summary:
|
122
|
+
summary: Change the space into dash
|
120
123
|
test_files:
|
121
124
|
- spec/space2dash_spec.rb
|
122
125
|
- spec/spec_helper.rb
|