space2underscore 0.0.6 → 0.0.7

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: 86ff16536a69bdcb282f7c4bfbfa874998ea6287
4
- data.tar.gz: cc876ae811e74eb85941f3372a3c7ab7d3e67830
3
+ metadata.gz: 4a741e7b5f27c13b47aadb914b79618e0f41c2c4
4
+ data.tar.gz: feeb162aee9722aad1749071d920a62d2cb44462
5
5
  SHA512:
6
- metadata.gz: 8326a13c042c63b6afd8a44053f1ed67276f2f75a619c8503bfe63ef6032b2fb26d93da36e8657ff46be52e892f77f9c8df39d985a6b2ef45212850412778ba4
7
- data.tar.gz: 72cf2ce70a187d41bafd86c39ad8c6f834d0ce36fd9e1facf16e41eae825c5ff18b52a21d9e634bab1549808c3e70dc6faf3b3b04d66d39c7c3b1c02d1c136b6
6
+ metadata.gz: 7b69ef33be0c96d314fe810480e875ad6b8afa8657128dd031b16c4371a8b0aeab763759edc38ec6e7f0d93d9d06a6876f5697ce9b999505f1b5624a78443d2c
7
+ data.tar.gz: 13d3474faca70effa7686450abdbbf1e00f38672fa2f4ee34cdf43071e8bd03d98385b7138c85004d538d43de1df91a156f8735fc95eb1d8a44540360b2d3da0
data/bin/space2underscore CHANGED
@@ -2,5 +2,6 @@
2
2
 
3
3
  require 'space2underscore'
4
4
 
5
- result = Space2underscore.convert_to_underscore(ARGV)
6
- puts result.first; system(result.last)
5
+ result = Space2underscore.convert_to_underscore(ARGV)
6
+ command = Space2underscore.copy_command(result)
7
+ puts result.first; system(command)
@@ -1,3 +1,3 @@
1
1
  module Space2underscore
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -1,9 +1,11 @@
1
1
  require 'space2underscore/version'
2
2
 
3
3
  module Space2underscore
4
- def self.convert_to_underscore(argv)
5
- space_include_sentence = argv.length == 1 ? argv.first.gsub(/\s/, '_') : argv.join('_')
6
- copy_command = "echo #{space_include_sentence} | ruby -pe 'chomp' | pbcopy"
7
- return space_include_sentence, copy_command
4
+ def self.convert(argv)
5
+ argv.length == 1 ? argv.first.gsub(/\s/, '_') : argv.join('_')
6
+ end
7
+
8
+ def self.copy_command(space_include_sentence)
9
+ "echo #{space_include_sentence} | ruby -pe 'chomp' | pbcopy"
8
10
  end
9
11
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Space2underscore do
4
4
  it 'Successful execution' do
5
- expect(Space2underscore.convert_to_underscore(['fuga hoge foo']).first).to eq('fuga_hoge_foo') # String case
6
- expect(Space2underscore.convert_to_underscore(%w(fuga hoge foo)).first).to eq('fuga_hoge_foo') # Array case
5
+ expect(Space2underscore.convert(['fuga hoge foo'])).to eq('fuga_hoge_foo') # String case
6
+ expect(Space2underscore.convert(%w(fuga hoge foo))).to eq('fuga_hoge_foo') # Array case
7
7
  end
8
8
  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.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - sachin21
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-17 00:00:00.000000000 Z
11
+ date: 2014-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler