space2underscore 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -0
- data/.travis.yml +1 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +4 -2
- data/Rakefile +18 -2
- data/bin/s2u +2 -0
- data/bin/space2underscore +2 -0
- data/lib/space2underscore.rb +13 -12
- data/lib/space2underscore/version.rb +4 -1
- data/space2underscore.gemspec +3 -2
- data/spec/space2underscore_spec.rb +17 -18
- data/spec/spec_helper.rb +12 -8
- metadata +30 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3846ccf345bdba7ac7d3438edff689aa28eb08c3
|
4
|
+
data.tar.gz: 4eb7b8b678366b3df3626ebcfb48db1b8db5a001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3f3ce641c0d7e9560a59de937c890e970f8bd96e432a00fe3e38c198688850def733e62f359e4be04647be959ac29b9afcc54ebc0880bf756460f2d52229a1a
|
7
|
+
data.tar.gz: 37062762fd3f18a12c8897dee3063a5497efad06215acb1ecbb7dc417f09303ce262168ea3aa7a32d98548bb14a1293eb2951e6b0c86f0d4c31ec51152ba0402
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -4,14 +4,11 @@ rvm:
|
|
4
4
|
- 2.1.2
|
5
5
|
- 2.1.1
|
6
6
|
- 2.1.0
|
7
|
-
- 1.9.3-p547
|
8
7
|
- 1.9.3-p392
|
9
8
|
- 1.9.3-p429
|
10
9
|
- 1.9.3-p448
|
11
|
-
- 1.9.3-p484
|
12
|
-
- 1.9.3-p545
|
13
10
|
|
14
|
-
script: "bundle exec
|
11
|
+
script: "bundle exec rake spec:with_coveralls"
|
15
12
|
|
16
13
|
notifications:
|
17
14
|
slack: sachin21dev:3pEyff2UFnoCgl4NI0uxbsER
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## v0.3.8
|
4
|
+
- Refactored for hiding command results.
|
5
|
+
- Added a task for the RSpec and SimpleCov.
|
6
|
+
- Use Rubocop and Fix issues of Rubocop.
|
7
|
+
- Use shorthand alias in `README.md`.
|
8
|
+
- Modified post install message.
|
9
|
+
|
3
10
|
## v0.3.7
|
4
11
|
- Added gems for coverage and use COVERALLS and SimpleCov.
|
5
12
|
- Wrote configurations for COVERALLS and SimpleCov.
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,22 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
3
5
|
|
4
6
|
RSpec::Core::RakeTask.new(:spec)
|
5
7
|
|
6
8
|
task default: :spec
|
9
|
+
|
10
|
+
namespace :spec do
|
11
|
+
desc 'Run RSpec with SimpleCov'
|
12
|
+
task :with_simplecov do
|
13
|
+
ENV['SIMPLECOV'] = 'true'
|
14
|
+
Rake::Task['spec'].execute
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Run RSpec with Coveralls'
|
18
|
+
task :with_coveralls do
|
19
|
+
ENV['COVERALLS'] = 'true'
|
20
|
+
Rake::Task['spec'].execute
|
21
|
+
end
|
22
|
+
end
|
data/bin/s2u
CHANGED
data/bin/space2underscore
CHANGED
data/lib/space2underscore.rb
CHANGED
@@ -1,17 +1,9 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
require 'space2underscore/version'
|
3
3
|
|
4
|
+
# This is the main functions.
|
4
5
|
module Space2underscore
|
5
|
-
|
6
|
-
argv.length == 1 ? argv[0].strip.gsub(/\s/, '_') : argv.join('_')
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.create_new_branch(underscore_include_sentence)
|
10
|
-
system "git checkout -b #{underscore_include_sentence} > /dev/null 2>&1"
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.usage
|
14
|
-
message = <<-EOF.chomp
|
6
|
+
MESSAGE = <<-EOF.chomp
|
15
7
|
NAME:
|
16
8
|
space2underscore - Change the space into underscore
|
17
9
|
|
@@ -28,8 +20,17 @@ module Space2underscore
|
|
28
20
|
|
29
21
|
OPTIONS:
|
30
22
|
--create, -c create the new branch
|
31
|
-
|
23
|
+
EOF
|
32
24
|
|
33
|
-
|
25
|
+
def self.convert(argv)
|
26
|
+
argv.length == 1 ? argv[0].strip.gsub(/\s/, '_') : argv.join('_')
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.create_new_branch(underscore_include_sentence)
|
30
|
+
system "git checkout -b #{underscore_include_sentence} &> /dev/null"
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.usage
|
34
|
+
MESSAGE.gsub(' ', '')
|
34
35
|
end
|
35
36
|
end
|
data/space2underscore.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.post_install_message = <<-EOF
|
21
|
+
spec.post_install_message = <<-EOF.gsub(' ', '')
|
22
22
|
..........................................................
|
23
23
|
__________________________________________________________
|
24
24
|
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
From the command line:
|
30
30
|
|
31
|
-
$
|
31
|
+
$ s2u new branch -c
|
32
32
|
=> Switched to the new branch 'new_branch’
|
33
33
|
|
34
34
|
Or
|
@@ -43,4 +43,5 @@ Gem::Specification.new do |spec|
|
|
43
43
|
spec.add_development_dependency 'rake'
|
44
44
|
spec.add_development_dependency 'rspec'
|
45
45
|
spec.add_development_dependency 'pry'
|
46
|
+
spec.add_development_dependency 'rubocop'
|
46
47
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Space2underscore do
|
4
6
|
let(:branch_name) { 'foo_bar' }
|
5
|
-
let(:hidden) { '
|
7
|
+
let(:hidden) { '&> /dev/null' }
|
6
8
|
|
7
9
|
describe '.convert' do
|
8
10
|
it 'returns underscore included in string' do
|
@@ -11,11 +13,12 @@ describe Space2underscore do
|
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
16
|
+
def checkout_master
|
17
|
+
system("git checkout master #{hidden}")
|
18
|
+
end
|
17
19
|
|
18
|
-
|
20
|
+
def delete_branch
|
21
|
+
system("git branch -D #{branch_name} #{hidden}")
|
19
22
|
end
|
20
23
|
|
21
24
|
def create_branch
|
@@ -23,22 +26,18 @@ describe Space2underscore do
|
|
23
26
|
end
|
24
27
|
|
25
28
|
describe '.create_new_branch' do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
before { checkout_and_remove_branch }
|
30
|
-
|
31
|
-
it 'creates the new branch' do
|
32
|
-
expect(Space2underscore.create_new_branch(branch_name)).to be_truthy
|
33
|
-
end
|
29
|
+
before do
|
30
|
+
checkout_master
|
31
|
+
delete_branch
|
34
32
|
end
|
35
33
|
|
36
|
-
|
37
|
-
|
34
|
+
after do
|
35
|
+
checkout_master
|
36
|
+
delete_branch
|
37
|
+
end
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
end
|
39
|
+
it 'creates the new branch' do
|
40
|
+
expect(Space2underscore.create_new_branch(branch_name)).to be_truthy
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,17 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
require 'bundler/setup'
|
2
4
|
require 'coveralls'
|
3
|
-
Coveralls.wear!
|
4
|
-
|
5
5
|
require 'space2underscore'
|
6
6
|
require 'simplecov'
|
7
7
|
|
8
|
-
|
9
|
-
SimpleCov::Formatter::HTMLFormatter,
|
10
|
-
Coveralls::SimpleCov::Formatter
|
11
|
-
]
|
8
|
+
Coveralls.wear! if ENV['COVERALLS']
|
12
9
|
|
13
|
-
|
14
|
-
|
10
|
+
if ENV['SIMPLECOV']
|
11
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
12
|
+
SimpleCov::Formatter::HTMLFormatter,
|
13
|
+
Coveralls::SimpleCov::Formatter
|
14
|
+
]
|
15
|
+
|
16
|
+
SimpleCov.start do
|
17
|
+
add_filter '/vendor/'
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
Bundler.setup
|
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.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sachin21
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Change the space into underscore
|
70
84
|
email:
|
71
85
|
- sachin21.developer@gmail.com
|
@@ -77,6 +91,7 @@ extra_rdoc_files: []
|
|
77
91
|
files:
|
78
92
|
- ".gitignore"
|
79
93
|
- ".rspec"
|
94
|
+
- ".rubocop.yml"
|
80
95
|
- ".travis.yml"
|
81
96
|
- CHANGELOG.md
|
82
97
|
- Gemfile
|
@@ -94,25 +109,25 @@ homepage: http://github.com/sachin21/space2underscore
|
|
94
109
|
licenses:
|
95
110
|
- MIT
|
96
111
|
metadata: {}
|
97
|
-
post_install_message: |
|
98
|
-
|
99
|
-
|
112
|
+
post_install_message: |
|
113
|
+
..........................................................
|
114
|
+
__________________________________________________________
|
100
115
|
|
101
|
-
|
116
|
+
Thank you for installing space2underscore.
|
102
117
|
|
103
|
-
|
118
|
+
************************* Usage **************************
|
104
119
|
|
105
|
-
|
120
|
+
From the command line:
|
106
121
|
|
107
|
-
|
108
|
-
|
122
|
+
$ s2u new branch -c
|
123
|
+
=> Switched to the new branch 'new_branch’
|
109
124
|
|
110
|
-
|
125
|
+
Or
|
111
126
|
|
112
|
-
|
127
|
+
$ git branch -m $(space2underscore renamed branch)
|
113
128
|
|
114
|
-
|
115
|
-
|
129
|
+
----------------------------------------------------------
|
130
|
+
..........................................................
|
116
131
|
rdoc_options: []
|
117
132
|
require_paths:
|
118
133
|
- lib
|
@@ -128,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
143
|
version: '0'
|
129
144
|
requirements: []
|
130
145
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.4.5
|
132
147
|
signing_key:
|
133
148
|
specification_version: 4
|
134
149
|
summary: Change the space into underscore
|