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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd424863837b78ec2e4f0748477abe9986c5172d
4
- data.tar.gz: 0807ac4427afdfdf0f31594fb7e73912828f1e1c
3
+ metadata.gz: 3846ccf345bdba7ac7d3438edff689aa28eb08c3
4
+ data.tar.gz: 4eb7b8b678366b3df3626ebcfb48db1b8db5a001
5
5
  SHA512:
6
- metadata.gz: a26458786cbd60a5726e63c8c9ccadc533db3562737f03557b47cca4b57a83a35e2b1bb9e4e785679d085f80f5ff0738de5560d38e78322a8ad98b62136ba950
7
- data.tar.gz: 4f0ef248772a46265df86e0512cfe9ba2e783fe497ff47a4f547d1b0800e7b72b89c594f7304a3b2cc8c7f70e5cf4c2ac119eeac7a12642699b1bccfa1a40e8e
6
+ metadata.gz: e3f3ce641c0d7e9560a59de937c890e970f8bd96e432a00fe3e38c198688850def733e62f359e4be04647be959ac29b9afcc54ebc0880bf756460f2d52229a1a
7
+ data.tar.gz: 37062762fd3f18a12c8897dee3063a5497efad06215acb1ecbb7dc417f09303ce262168ea3aa7a32d98548bb14a1293eb2951e6b0c86f0d4c31ec51152ba0402
data/.rubocop.yml ADDED
@@ -0,0 +1,7 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'vendor/**/*'
4
+ - 'spec/fixtures/**/*'
5
+
6
+ Style/Encoding:
7
+ Enabled: true
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 rspec spec"
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
@@ -1,6 +1,8 @@
1
+ # coding: utf-8
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
- gem 'coveralls', require: false
6
- gem 'simplecov', require: false
7
+ gem 'coveralls', '0.8.3', require: false
8
+ gem 'simplecov', require: false
data/Rakefile CHANGED
@@ -1,6 +1,22 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
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
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # coding: utf-8
3
+
2
4
  require 'space2underscore'
3
5
 
4
6
  CREATE_FLAGS = %w(-c --create)
data/bin/space2underscore CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # coding: utf-8
3
+
2
4
  require 'space2underscore'
3
5
 
4
6
  CREATE_FLAGS = %w(-c --create)
@@ -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
- def self.convert(argv)
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
- EOF
23
+ EOF
32
24
 
33
- message.gsub(' ', '')
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
@@ -1,3 +1,6 @@
1
+ # coding: utf-8
2
+
3
+ # This module holds the Space2underscore version information.
1
4
  module Space2underscore
2
- VERSION = '0.3.7'
5
+ VERSION = '0.3.8'
3
6
  end
@@ -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
- $ space2underscore new branch -c
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) { '> /dev/null 2>&1'}
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 checkout_and_remove_branch
15
- checkout_master = "git checkout master #{hidden}"
16
- delete_branch = "git branch -D #{branch_name} #{hidden}"
16
+ def checkout_master
17
+ system("git checkout master #{hidden}")
18
+ end
17
19
 
18
- system("#{checkout_master}; #{delete_branch}")
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
- after { checkout_and_remove_branch }
27
-
28
- context "when exist a git repository" do
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
- context "when exist a git repository" do
37
- before { create_branch }
34
+ after do
35
+ checkout_master
36
+ delete_branch
37
+ end
38
38
 
39
- it 'creates the new branch' do
40
- expect(Space2underscore.create_new_branch(branch_name)).to be_falsey
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
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
9
- SimpleCov::Formatter::HTMLFormatter,
10
- Coveralls::SimpleCov::Formatter
11
- ]
8
+ Coveralls.wear! if ENV['COVERALLS']
12
9
 
13
- SimpleCov.start do
14
- add_filter '/vendor/'
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.7
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-10-24 00:00:00.000000000 Z
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: |2
98
- ..........................................................
99
- __________________________________________________________
112
+ post_install_message: |
113
+ ..........................................................
114
+ __________________________________________________________
100
115
 
101
- Thank you for installing space2underscore.
116
+ Thank you for installing space2underscore.
102
117
 
103
- ************************* Usage **************************
118
+ ************************* Usage **************************
104
119
 
105
- From the command line:
120
+ From the command line:
106
121
 
107
- $ space2underscore new branch -c
108
- => Switched to the new branch 'new_branch’
122
+ $ s2u new branch -c
123
+ => Switched to the new branch 'new_branch’
109
124
 
110
- Or
125
+ Or
111
126
 
112
- $ git branch -m $(space2underscore renamed branch)
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.2.2
146
+ rubygems_version: 2.4.5
132
147
  signing_key:
133
148
  specification_version: 4
134
149
  summary: Change the space into underscore