space2underscore 0.3.9 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb322f523081337eca3ea59a3203c05286227a92
4
- data.tar.gz: 4df307124bce05b5c37ef177d610ad141a56c8fc
3
+ metadata.gz: 5d49b214eaa29c5138354cdeb568350d845c7640
4
+ data.tar.gz: d470a4a7bfd2225b1359bd87693cee0319555901
5
5
  SHA512:
6
- metadata.gz: 4c8b477aa22dc20bc691528bbe5fe1c163c1f74ea972b6565a54f6d73f2eea1eade9900e9c6c9144c197e40914224675afff26bd0fafc1e9bb586fbde1b2258d
7
- data.tar.gz: 9b48c4491eb713d377b34f4c38d0e02e81d7067dccb219539bcd3089c27ad78f4200a44639948da514dcbd875c356327330c8c373d166d6809105361ed7f2bbf
6
+ metadata.gz: be3f4ded6e33d9c09b4a4be95af561b6bb4b9dcc6ab846b945be1df6ff71377801edeb853b0860f45db0dd5a1de27238c8fe339aa94ed4039869896bfdb4fd0b
7
+ data.tar.gz: c9d10d930d88734cbcec994a7a3c2aa4df728caf6ff715fddfb604ece274fc0a84d06d88e2441ab935cd230199166f9611c8e4a34883af110ad2dd7ced788a67
data/.gitignore CHANGED
@@ -15,4 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
- /vendor/bundle
18
+ /vendor
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
+ - ruby-2.3.0
4
5
  - 2.1.2
5
6
  - 2.1.1
6
7
  - 2.1.0
@@ -8,6 +9,9 @@ rvm:
8
9
  - 1.9.3-p429
9
10
  - 1.9.3-p448
10
11
 
12
+ before_install:
13
+ - gem install bundler || gem update bundler
14
+
11
15
  script: "bundle exec rake spec:with_coveralls"
12
16
 
13
17
  notifications:
data/CHANGELOG.md CHANGED
@@ -18,7 +18,7 @@
18
18
  - Wrote configurations for COVERALLS and SimpleCov.
19
19
  - Hid git command's result.
20
20
  - Modified methods specifications.
21
- - Wrote spec for .create_new_branch and .usage.
21
+ - Wrote spec for `.create_new_branch` and `.usage`.
22
22
  - Changed print method from print to puts.
23
23
  - Added badges.
24
24
  - Fixed typos.
data/bin/s2u CHANGED
@@ -8,19 +8,12 @@ CREATE_FLAGS = %w(-c --create)
8
8
  args = ARGV.reject { |arg| CREATE_FLAGS.include?(arg) }
9
9
  underscore_include_sentence = Space2underscore.convert(args)
10
10
 
11
- result =
12
- if ARGV.empty?
13
- Space2underscore.usage
11
+ if ARGV.empty?
12
+ puts Space2underscore.usage
13
+ else
14
+ if ARGV.include?('-c') || ARGV.include?('--create')
15
+ Space2underscore.create_new_branch(underscore_include_sentence)
14
16
  else
15
- if ARGV.include?('-c') || ARGV.include?('--create')
16
- if Space2underscore.create_new_branch(underscore_include_sentence)
17
- "Switched to a new branch '#{underscore_include_sentence}'"
18
- else
19
- "fatal: A branch named '#{underscore_include_sentence}' already exists."
20
- end
21
- else
22
- underscore_include_sentence
23
- end
17
+ puts underscore_include_sentence
24
18
  end
25
-
26
- puts result
19
+ end
data/bin/space2underscore CHANGED
@@ -8,19 +8,12 @@ CREATE_FLAGS = %w(-c --create)
8
8
  args = ARGV.reject { |arg| CREATE_FLAGS.include?(arg) }
9
9
  underscore_include_sentence = Space2underscore.convert(args)
10
10
 
11
- result =
12
- if ARGV.empty?
13
- Space2underscore.usage
11
+ if ARGV.empty?
12
+ puts Space2underscore.usage
13
+ else
14
+ if ARGV.include?('-c') || ARGV.include?('--create')
15
+ Space2underscore.create_new_branch(underscore_include_sentence)
14
16
  else
15
- if ARGV.include?('-c') || ARGV.include?('--create')
16
- if Space2underscore.create_new_branch(underscore_include_sentence)
17
- "Switched to a new branch '#{underscore_include_sentence}'"
18
- else
19
- "fatal: A branch named '#{underscore_include_sentence}' already exists."
20
- end
21
- else
22
- underscore_include_sentence
23
- end
17
+ puts underscore_include_sentence
24
18
  end
25
-
26
- puts result
19
+ end
@@ -27,7 +27,7 @@ module Space2underscore
27
27
  end
28
28
 
29
29
  def self.create_new_branch(underscore_include_sentence)
30
- system "git checkout -b #{underscore_include_sentence} &> /dev/null"
30
+ system "git checkout -b #{underscore_include_sentence}"
31
31
  end
32
32
 
33
33
  def self.usage
@@ -2,5 +2,5 @@
2
2
 
3
3
  # This module holds the Space2underscore version information.
4
4
  module Space2underscore
5
- VERSION = '0.3.9'
5
+ VERSION = '0.4.0'
6
6
  end
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  Or
35
35
 
36
- $ git branch -m $(space2underscore renamed branch)
36
+ $ git branch -m $(s2u renamed branch)
37
37
 
38
38
  ----------------------------------------------------------
39
39
  ..........................................................
@@ -46,7 +46,7 @@ describe Space2underscore do
46
46
  end
47
47
 
48
48
  describe '.usage' do
49
- it 'returns string' do
49
+ it 'returns String class' do
50
50
  expect(Space2underscore.usage).to be_a(String)
51
51
  end
52
52
 
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,13 @@
1
1
  # coding: utf-8
2
2
 
3
3
  require 'bundler/setup'
4
- require 'coveralls'
5
4
  require 'space2underscore'
6
5
 
7
- Coveralls.wear! if ENV['COVERALLS']
6
+ if ENV['COVERALLS']
7
+ require 'coveralls'
8
+ Coveralls.wear!
9
+ end
10
+
8
11
  Bundler.setup
9
12
 
10
13
  RSpec.configure do |config|
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.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sachin21
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2016-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -124,7 +124,7 @@ post_install_message: |
124
124
 
125
125
  Or
126
126
 
127
- $ git branch -m $(space2underscore renamed branch)
127
+ $ git branch -m $(s2u renamed branch)
128
128
 
129
129
  ----------------------------------------------------------
130
130
  ..........................................................
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project:
146
- rubygems_version: 2.4.5
146
+ rubygems_version: 2.4.5.1
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Change the space into underscore