space2underscore 0.4.3 → 0.5.0

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: 6f3b7d4e7f299a37490567b9134d31dc3dabb478
4
- data.tar.gz: '08a2149378b48a5acfdee8a7112e4b993d4a0f2f'
3
+ metadata.gz: 33b248282eda7c95fdc3e9dfb70692bb4dee6804
4
+ data.tar.gz: ebce903b96d2d390a77cc2c9faa707bb8010555d
5
5
  SHA512:
6
- metadata.gz: 3192dc420fd42e3dac0b155736df3364fd4ed5dea5ed2758b5dfaf894541e2bc76f8a68ede0d6b18d846a6e8a7c4dc07ef65b9054100cd1795f23e41a99963b3
7
- data.tar.gz: 8555418048a5df8fa0705d0920b779f0cf282b3cb70c158cd50399567ad88bc52c87c355440332f4211b4163239ed34b9c2f7d00f6b0ab1aa0dbd366e5e1ee53
6
+ metadata.gz: 055e2c042fb47bcc496711b7e7e7f05bb25336426bc4dd68498e6a29a221f992c10fdb5c9b5246485e3aa999b8bc483446cdeeabebe538e2691993e396397001
7
+ data.tar.gz: 1de34f8700df216d3a084e71be935e2e0bf16713410b9570a85a657622bd9b463c3cad8d36a57c56688c1cc4d5654e32c8b7a699be6cef3a6ef4bc1c34bd907b
@@ -1,5 +1,26 @@
1
1
  # Space2underscore Change Log
2
2
 
3
+ ## v0.5.0
4
+ - Add a task for tagging
5
+ - Add tests for bins
6
+
7
+ ### Critical bug fix
8
+ - Change the symbolic link to plain text
9
+
10
+ ## v0.4.3
11
+ - Fix critical typo
12
+
13
+ ## v0.4.2
14
+ - Fix issues according to RuboCop
15
+
16
+ ## v0.4.1
17
+ - Drop test for 1.9
18
+
19
+ ## v0.4.0
20
+ - Use git's original result
21
+ - Add an alias for space2underscore
22
+ - Add travis CI testing target for new ruby version
23
+
3
24
  ## v0.3.9
4
25
  - Do not use SimpleCov.
5
26
  - license file is renamed from LICENSE.txt to MIT-LICENSE.
data/bin/s2u ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'space2underscore'
5
+ require 'pry'
6
+
7
+ CREATE_FLAGS = %w(-c --create).freeze
8
+
9
+ args = ARGV.reject { |arg| CREATE_FLAGS.include?(arg) }
10
+ convert_flag = ARGV.select { |arg| CREATE_FLAGS.include?(arg) }
11
+ underscore_include_sentence = Space2underscore.convert(args)
12
+
13
+ return puts Space2underscore.usage if ARGV.empty?
14
+
15
+ if convert_flag.empty?
16
+ puts underscore_include_sentence
17
+ else
18
+ Space2underscore.create_new_branch(underscore_include_sentence)
19
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # This module holds the Space2underscore version information.
4
4
  module Space2underscore
5
- VERSION = '0.4.3'
5
+ VERSION = '0.5.0'
6
6
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'spec_helper'
4
+ require 'open3'
4
5
 
5
6
  describe Space2underscore do
6
7
  let(:branch_name) { 'foo_bar' }
@@ -54,4 +55,37 @@ describe Space2underscore do
54
55
  expect(Space2underscore.usage).not_to be_nil
55
56
  end
56
57
  end
58
+
59
+ describe 'bin' do
60
+ let(:argument1) { 'hoge' }
61
+ let(:argument2) { 'fuga' }
62
+ let(:result) { Open3.capture2(bin, argument1, argument2) }
63
+ subject(:output) { result[0] }
64
+ subject(:status) { result[1] }
65
+
66
+ shared_examples_for 'output' do
67
+ it 'returns underscore included in string' do
68
+ expect(output).to eq "hoge_fuga\n"
69
+ end
70
+ end
71
+
72
+ shared_examples_for 'status' do
73
+ it 'returns underscore included in string' do
74
+ expect(status.success?).to be true
75
+ end
76
+ end
77
+
78
+ context 'with Space2underscore' do
79
+ let(:bin) { File.join('bin', 's2u') }
80
+
81
+ it_behaves_like 'output'
82
+ it_behaves_like 'status'
83
+ end
84
+ context 'with s2u' do
85
+ let(:bin) { File.join('bin', 'space2underscore') }
86
+
87
+ it_behaves_like 'output'
88
+ it_behaves_like 'status'
89
+ end
90
+ end
57
91
  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.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sachin21
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-08 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.6.8
147
+ rubygems_version: 2.6.10
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Change the space into underscore
data/bin/s2u DELETED
@@ -1 +0,0 @@
1
- bin/space2underscore