podspec_bump 0.0.2 → 0.0.3

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: 0677d15beb9aa4a7d8b78c387420d20b5c25f0ac
4
- data.tar.gz: ae5564c87dfdd96200c32ffd82c14541aea4c640
3
+ metadata.gz: fec20716ffdf427df44e239e6bbdb3cc44a452c2
4
+ data.tar.gz: a21e1343a76473418212d252dd45a4acc16425a4
5
5
  SHA512:
6
- metadata.gz: 7fd935a84ea928e05c388260aec477e0ebdee4b8ea9a50eabaf56ea4b04d44fa65af2208044c1991c4b1fac2c8645d15c60148e656cc0529866465fb31a0847c
7
- data.tar.gz: a010332bd040579bd3328ae1174f059629ec604cb636a308f9ec907b978b28c1308add9e6efe0722c23f61a8942a5ce9189a1668db6a846594882877549e9d2c
6
+ metadata.gz: bd32147031f08d46f446d0eaf728fc9c9b49a2c748602a3b3c0c13ffde7a5e178953046584060dcf04555045a557df2431220bb9db4579191c29a469141e54bf
7
+ data.tar.gz: 6c81ed108f5631815449c9c891dddc61bd8eb9f6555c083cf49f0ed00a7624d7f183ede03fe5ff7e3d06a66a874a3326b5d7e3d25783e9fd1d3b371e0f2aebc3
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- [![Gem Version](https://github.com/nakajijapan/podspec_bump.png)](http://badge.fury.io/rb/podspec_bump)
1
+ [![Gem Version](https://badge.fury.io/rb/podspec_bump.svg)](http://badge.fury.io/rb/podspec_bump)
2
+ [![wercker status](https://app.wercker.com/status/90ee9101067ce48b2c689f6b688baf91/s "wercker status")](https://app.wercker.com/project/bykey/90ee9101067ce48b2c689f6b688baf91)
2
3
 
3
4
  # PodspecBump
4
5
 
@@ -26,19 +27,15 @@ Or install it yourself as:
26
27
  Curent version
27
28
 
28
29
  ```
29
- bump current
30
+ podspec_bump current
30
31
  ```
31
32
 
32
33
  Bump (major, minor, patch, pre)
33
34
 
34
35
  ```
35
- bump patch
36
+ podspec_bump patch
36
37
  ```
37
38
 
38
- ## Todo
39
-
40
- test...
41
-
42
39
  ## Contributing
43
40
 
44
41
  1. Fork it ( https://github.com/[my-github-username]/podspec_bump/fork )
@@ -1,3 +1,3 @@
1
1
  module PodspecBump
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/podspec_bump.rb CHANGED
@@ -7,7 +7,7 @@ module PodspecBump
7
7
 
8
8
  class Bump
9
9
  BUMPS = %w(major minor patch)
10
- OPTIONS = BUMPS | ["set", "current"]
10
+ OPTIONS = BUMPS | ["current"]
11
11
  VERSION_REGEX = /(\d+\.\d+\.\d+)/
12
12
 
13
13
  def self.run(bump, options={})
data/podspec_bump.gemspec CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.7"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "rspec", '~> 0'
24
- spec.add_development_dependency "colorize", '~> 0'
23
+ spec.add_development_dependency "rspec", '>= 0'
24
+ spec.add_development_dependency "colorize", '>= 0'
25
25
  end
@@ -1,11 +1,85 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe PodspecBump do
4
+
5
+ after do
6
+ File.delete('fixture.podspec') if File.exist?('fixture.podspec')
7
+ end
8
+
4
9
  it 'has a version number' do
5
10
  expect(PodspecBump::VERSION).not_to be nil
6
11
  end
7
12
 
8
- it 'does something useful' do
9
- expect(false).to eq(true)
13
+ it 'fail if it cannot find anything to bump' do
14
+ expect(podspec_bump('current', fail: false)).to include 'Not found your spec file'
10
15
  end
16
+
17
+ it 'fail without command' do
18
+ write_podspec
19
+ expect(podspec_bump('', fail: false)).to include 'Invalid option. Choose between major,minor,patch,current.'
20
+ end
21
+
22
+ it "show help" do
23
+ expect(podspec_bump("--help")).to include 'podspec_bump current'
24
+ end
25
+
26
+ context 'version in fixture.podspec' do
27
+ before do
28
+ write_podspec
29
+ end
30
+
31
+ it 'current is correct version' do
32
+ expect(podspec_bump('current', fail: false)).to include 'Current version: 4.2.3'
33
+ end
34
+
35
+ it 'patch is correct version' do
36
+ expect(podspec_bump('patch', fail: false)).to include '4.2.4'
37
+ expect(read('fixture.podspec')).to include '4.2.4'
38
+ end
39
+
40
+ it 'minor is correct version' do
41
+ expect(podspec_bump('minor', fail: false)).to include '4.3.0'
42
+ expect(read('fixture.podspec')).to include '4.3.0'
43
+ end
44
+
45
+ it 'major is correct version' do
46
+ expect(podspec_bump('major', fail: false)).to include '5.0.0'
47
+ expect(read('fixture.podspec')).to include '5.0.0'
48
+ end
49
+
50
+ it 'podspec_bump more then 10' do
51
+ expect(podspec_bump("patch")).to include '4.2.4'
52
+ expect(podspec_bump("patch")).to include '4.2.5'
53
+ expect(podspec_bump("patch")).to include '4.2.6'
54
+ expect(podspec_bump("patch")).to include '4.2.7'
55
+ expect(podspec_bump("patch")).to include '4.2.8'
56
+ expect(podspec_bump("patch")).to include '4.2.9'
57
+ expect(podspec_bump("patch")).to include '4.2.10'
58
+ expect(podspec_bump("patch")).to include '4.2.11'
59
+ expect(read('fixture.podspec')).to include '"4.2.11"'
60
+ end
61
+
62
+ end
63
+
64
+ private
65
+
66
+ def podspec_bump(command='', options={})
67
+ cmdline = "#{File.expand_path("../../bin/podspec_bump", __FILE__)} #{command}"
68
+ run cmdline, options
69
+ end
70
+
71
+ def write_podspec(version = '"4.2.3"')
72
+ write 'fixture.podspec', <<-RUBY.sub(" "*6, "")
73
+ Pod::Spec.new do |s|
74
+ s.name = "PodspecBump"
75
+ s.version = #{version}
76
+ s.summary = "summary summary"
77
+ s.homepage = "https://github.com"
78
+ s.license = 'MIT'
79
+ s.author = { "nakajijapan" => "test@google.com" }
80
+ s.source = { :git => "https://github.com/" :tag => s.version.to_s }
81
+ end
82
+ RUBY
83
+ end
84
+
11
85
  end
data/spec/spec_helper.rb CHANGED
@@ -1,2 +1,27 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
  require 'podspec_bump'
3
+
4
+ module SpecHelpers
5
+ module InstanceMethods
6
+ def write(file, content)
7
+ folder = File.dirname(file)
8
+ run "mkdir -p #{folder}" unless File.exist?(folder)
9
+ File.open(file, 'w'){|f| f.write content }
10
+ end
11
+
12
+ def read(file)
13
+ File.read(file)
14
+ end
15
+
16
+ def run(cmd, options={})
17
+ result = `#{cmd} 2>&1`
18
+ raise "FAILED #{cmd} --> #{result}" if $?.success? != !options[:fail]
19
+ result
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ RSpec.configure do |c|
26
+ c.include SpecHelpers::InstanceMethods
27
+ end
data/wercker.yml ADDED
@@ -0,0 +1,27 @@
1
+ # This references the default Ruby container from
2
+ # the Docker Hub.
3
+ # https://registry.hub.docker.com/_/ruby/
4
+ # If you want to use a specific version you would use a tag:
5
+ # ruby:2.2.2
6
+ box: ruby
7
+ # You can also use services such as databases. Read more on our dev center:
8
+ # http://devcenter.wercker.com/docs/services/index.html
9
+ # services:
10
+ # - postgres
11
+ # http://devcenter.wercker.com/docs/services/postgresql.html
12
+
13
+ # - mongodb
14
+ # http://devcenter.wercker.com/docs/services/mongodb.html
15
+
16
+ # This is the build pipeline. Pipelines are the core of wercker
17
+ # Read more about pipelines on our dev center
18
+ # http://devcenter.wercker.com/docs/pipelines/index.html
19
+ build:
20
+ # Steps make up the actions in your pipeline
21
+ # Read more about steps on our dev center:
22
+ # http://devcenter.wercker.com/docs/steps/index.html
23
+ steps:
24
+ - bundle-install
25
+ - script:
26
+ name: rspec
27
+ code: bundle exec rspec
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podspec_bump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nakajijapan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-20 00:00:00.000000000 Z
11
+ date: 2015-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,28 +42,28 @@ dependencies:
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: colorize
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: A command line tools to bump podspec version for CocoaPods. Inspired
@@ -77,7 +77,6 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - ".gitignore"
79
79
  - ".rspec"
80
- - ".travis.yml"
81
80
  - Gemfile
82
81
  - LICENSE.txt
83
82
  - README.md
@@ -88,6 +87,7 @@ files:
88
87
  - podspec_bump.gemspec
89
88
  - spec/podspec_bump_spec.rb
90
89
  - spec/spec_helper.rb
90
+ - wercker.yml
91
91
  homepage: http://www.nakajijapan.net
92
92
  licenses:
93
93
  - MIT
data/.travis.yml DELETED
@@ -1,3 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.5