anvil-core 0.0.1.alpha.1 → 0.0.1.pre.alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -3
  3. data/README.md +20 -8
  4. data/Rakefile +0 -1
  5. data/VERSION +1 -0
  6. data/bin/anvil +0 -2
  7. data/lib/anvil.rb +11 -1
  8. data/lib/anvil/rubygems.rb +6 -0
  9. data/lib/anvil/task.rb +4 -0
  10. data/lib/anvil/task_manager.rb +5 -2
  11. data/lib/anvil/version.rb +10 -1
  12. data/lib/anvil/versioner.rb +77 -0
  13. data/lib/tasks/{gem_build_task.rb → gem/build_task.rb} +1 -1
  14. data/lib/tasks/gem/bump_task.rb +61 -0
  15. data/lib/tasks/gem/release_task.rb +47 -0
  16. data/spec/lib/{assure_spec.rb → anvil/assure_spec.rb} +0 -0
  17. data/spec/lib/{assures → anvil/assures}/directory_assure_spec.rb +3 -1
  18. data/spec/lib/{assures → anvil/assures}/file_assure_spec.rb +2 -1
  19. data/spec/lib/{cli_spec.rb → anvil/cli_spec.rb} +0 -0
  20. data/spec/lib/{config_spec.rb → anvil/config_spec.rb} +1 -1
  21. data/spec/lib/{task → anvil/task}/naming_spec.rb +0 -0
  22. data/spec/lib/{task → anvil/task}/options_spec.rb +0 -0
  23. data/spec/lib/{task_manager_spec.rb → anvil/task_manager_spec.rb} +1 -1
  24. data/spec/lib/{task_spec.rb → anvil/task_spec.rb} +0 -0
  25. data/spec/lib/anvil/versioner_spec.rb +46 -0
  26. data/spec/lib/tasks/{gem_build_task_spec.rb → gem/build_task_spec.rb} +8 -8
  27. data/spec/lib/tasks/gem/bump_task_spec.rb +15 -0
  28. data/spec/lib/tasks/gem/release_task_spec.rb +23 -0
  29. data/spec/spec_helper.rb +3 -2
  30. data/spec/support/shared/config_context.rb +2 -0
  31. data/spec/support/shared/fake_fs_context.rb +4 -0
  32. metadata +45 -36
  33. data/.gitignore +0 -20
  34. data/.travis.yml +0 -4
  35. data/anvil-core.gemspec +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c082eabf101a620961dc1325d55a7235e427ba62
4
- data.tar.gz: 4b78960acabfbe004739467088eb9ed28cdc1ba1
3
+ metadata.gz: 84737f5a429924a351d2d4b20c0206c5bd015b20
4
+ data.tar.gz: 858cd983bf2629fafa1b781d6748985e326d95b5
5
5
  SHA512:
6
- metadata.gz: a60cd3ccd83e0caa7cf709e2cb22888aeebd47d5082c97da61e1ea37f87a1d20a0c3cf1028aea0055c34ad1fa32aa3d08945832e19be9d5e1359a8d7b749fb47
7
- data.tar.gz: 9d0d04affd45adc653858b94dbbfec6dbbe348c602a2532ef3902188f7fe2a702508bf32fe25d3829defe7d8fb1a6ae6583f78007f6332bcf1d1b0434f25d9a9
6
+ metadata.gz: 870d9fae3fcb4a4c48aa716a8aeb36770e62b95931208b60e26ccffe34c71d09a4023c87267fa8fd0454a51147bcc35088f913d41b8670101d16523bf9d50718
7
+ data.tar.gz: 26769111bd818fd5833258819baf744a074d3d9fe2e4b87aad2170ce383214ea4ec5594e695ca516819c26211edfe02bd83fe43909d1bc9f466c8e7cf21f6f98
data/Gemfile CHANGED
@@ -3,6 +3,4 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in anvil-core.gemspec
4
4
  gemspec
5
5
 
6
- group :test do
7
- gem 'rake'
8
- end
6
+ gem 'byebug', '~> 2.6'
data/README.md CHANGED
@@ -2,18 +2,28 @@
2
2
 
3
3
  Anvil is a tool for the real craftsmen to build its own tools.
4
4
 
5
- - [![Build Status](https://travis-ci.org/anvil-src/anvil-core.png?branch=master)](https://travis-ci.org/anvil-src/anvil-core)
5
+ [![Build Status](https://travis-ci.org/anvil-src/anvil-core.png?branch=master)](https://travis-ci.org/anvil-src/anvil-core)
6
6
 
7
7
 
8
- Anvil tries to be a framework for building command line applications to
9
- automate tedious tasks like apps or gems releasing process. Pull request
10
- updating, etc.
8
+ Anvil tries to be a framework for building command line applications
9
+ to automate tedious tasks like apps or gems releasing process. Pull
10
+ request updating, etc.
11
+
12
+ It's purpose is to provide an easy to use Object Oriented framework
13
+ that developers can use to automate par of its day to day work.
14
+
15
+ Things like:
16
+
17
+ * Updating your pull requests.
18
+ * Installing your dot files
19
+ * Doing complex build which involve several projects and branches.
20
+ * Any other stuff you might want.
11
21
 
12
22
  ## Installation
13
23
 
14
24
  To install it:
15
25
 
16
- gem install anvil
26
+ gem install anvil-core
17
27
 
18
28
  ## Usage
19
29
 
@@ -25,6 +35,8 @@ To see all the options execute:
25
35
 
26
36
  1. Fork it
27
37
  2. Create your feature branch (`git checkout -b my-new-feature`)
28
- 3. Commit your changes (`git commit -am 'Add some feature'`)
29
- 4. Push to the branch (`git push origin my-new-feature`)
30
- 5. Create new Pull Request
38
+ 3. Add tests for your new feature
39
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
40
+ 5. Push to the branch (`git push origin my-new-feature`)
41
+ 6. Create new Pull Request
42
+ 7. Make sure your tests are passing on all the rubies!
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- require 'bundler/gem_tasks'
2
1
  require 'rspec/core/rake_task'
3
2
 
4
3
  RSpec::Core::RakeTask.new(:spec)
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1-alpha.2
data/bin/anvil CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rubygems'
4
- require 'bundler/setup'
5
3
  require 'anvil'
6
4
 
7
5
  Anvil::Config.init
data/lib/anvil.rb CHANGED
@@ -2,7 +2,17 @@ require 'anvil/version'
2
2
  require 'active_support/core_ext'
3
3
 
4
4
  module Anvil
5
- # Your code goes here...
5
+ Error = Class.new(StandardError)
6
+
7
+ class << self
8
+ def logger
9
+ @logger ||= Logger.new(STDOUT).tap do |l|
10
+ l.formatter = proc do |*_, msg|
11
+ "#{msg}\n"
12
+ end
13
+ end
14
+ end
15
+ end
6
16
  end
7
17
 
8
18
  require 'anvil/config'
@@ -14,6 +14,12 @@ module Anvil
14
14
 
15
15
  line.run gem_file: gem_file
16
16
  end
17
+
18
+ def push(gem_file)
19
+ line = Cocaine::CommandLine.new 'gem', 'push :gem_file'
20
+
21
+ line.run gem_file: gem_file
22
+ end
17
23
  end
18
24
  end
19
25
  end
data/lib/anvil/task.rb CHANGED
@@ -22,6 +22,10 @@ module Anvil
22
22
  end
23
23
  end
24
24
 
25
+ def logger
26
+ Anvil.logger
27
+ end
28
+
25
29
  protected
26
30
 
27
31
  def run_after_callbacks
@@ -1,7 +1,6 @@
1
1
  require 'anvil/config'
2
2
  require 'anvil/task'
3
3
  require 'rubygems'
4
- require 'bundler/shared_helpers'
5
4
 
6
5
  module Anvil
7
6
  module TaskManager
@@ -17,10 +16,14 @@ module Anvil
17
16
  end
18
17
 
19
18
  def self.files_from_current_project
20
- path = File.dirname(Bundler::SharedHelpers.default_gemfile) + '/lib/anvil/'
19
+ path = current_project_path + '/lib/anvil/'
21
20
  files_from_path(path)
22
21
  end
23
22
 
23
+ def self.current_project_path
24
+ %x{git rev-parse --show-toplevel}.strip
25
+ end
26
+
24
27
  def self.files_from_path(path)
25
28
  Dir[path + '/tasks/**/*_task.rb']
26
29
  end
data/lib/anvil/version.rb CHANGED
@@ -1,3 +1,12 @@
1
1
  module Anvil
2
- VERSION = '0.0.1.alpha.1'
2
+ class << self
3
+ def version
4
+ version_path =
5
+ File.expand_path("#{File.dirname __FILE__}../../../VERSION")
6
+
7
+ File.read(version_path)
8
+ end
9
+ end
10
+
11
+ VERSION = Anvil.version
3
12
  end
@@ -0,0 +1,77 @@
1
+ require 'semantic/version'
2
+
3
+ module Anvil
4
+ class Versioner < SimpleDelegator
5
+ class NotSupportedTerm < Anvil::Error
6
+ def initialize(term)
7
+ super("Not supported term: #{term}")
8
+ end
9
+ end
10
+
11
+ TERMS = [:major, :minor, :patch, :pre, :build]
12
+ attr_reader :version
13
+
14
+ def initialize(string)
15
+ version = Semantic::Version.new(string)
16
+ super(version)
17
+ end
18
+
19
+ TERMS.each do |term|
20
+ define_method("#{term}!") { bump!(term) }
21
+ end
22
+
23
+ # Bumps a version by incrementing one of its terms and reseting the others
24
+ # according to semver specification.
25
+ #
26
+ # @example
27
+ # Versioner.new('1.2.3-alpha.1+build.2').bump(:major)
28
+ # # => '2.0.0'
29
+ # Versioner.new('1.2.3-alpha.1+build.2').bump(:minor)
30
+ # # => '1.3.0'
31
+ # Versioner.new('1.2.3-alpha.1+build.2').bump(:patch)
32
+ # # => '1.2.4'
33
+ # Versioner.new('1.2.3-alpha.1+build.2').bump(:pre)
34
+ # # => '1.2.3-alpha.2'
35
+ # Versioner.new('1.2.3-alpha.1+build.2').bump(:build)
36
+ # # => '1.2.3-alpha.2+build.3'
37
+ #
38
+ # @param term [Symbol] the term to increment
39
+ # @raise [Anvil::Versioner::NotSuportedTerm] When the given term is invalid
40
+ def bump!(term)
41
+ fail NotSupportedTerm.new(term) unless TERMS.include?(term.to_sym)
42
+
43
+ new_version = clone
44
+ new_value = increment send(term)
45
+
46
+ new_version.send("#{term}=", new_value)
47
+ new_version.reset_terms_for(term)
48
+ end
49
+
50
+ protected
51
+
52
+ def increment(old_value)
53
+ case old_value
54
+ when Fixnum
55
+ old_value + 1
56
+ when String
57
+ components = old_value.split('.')
58
+ components[-1] = components[-1].to_i + 1
59
+ components.join('.')
60
+ end
61
+ end
62
+
63
+ # Resets all the terms which need to be reset after a bump
64
+ #
65
+ # @param term [Symbol] The term which has been bumped
66
+ # @return [Anvil::Versioner] A new version with the proper number
67
+ # @todo we still need to reset pre-release and builds properly
68
+ def reset_terms_for(term)
69
+ self.minor = 0 if term == :major
70
+ self.patch = 0 if term == :major || term == :minor
71
+ self.pre = nil if [:major, :minor, :patch].include? term
72
+ self.build = nil if [:major, :minor, :patch, :pre].include? term
73
+
74
+ self
75
+ end
76
+ end
77
+ end
@@ -2,7 +2,7 @@ require 'fileutils'
2
2
  require 'anvil/task'
3
3
  require 'anvil/rubygems'
4
4
 
5
- class GemBuildTask < Anvil::Task
5
+ class Gem::BuildTask < Anvil::Task
6
6
  description 'Builds a gem for you and can install it on your system.'
7
7
 
8
8
  parser do
@@ -0,0 +1,61 @@
1
+ require 'anvil/task'
2
+ require 'anvil/versioner'
3
+
4
+ class Gem::BumpTask < Anvil::Task
5
+ description "Bumps a gem's version"
6
+
7
+ parser do
8
+ arguments %w[term]
9
+ end
10
+
11
+ attr_reader :term
12
+
13
+ def initialize(term, options = {})
14
+ @term = term
15
+ end
16
+
17
+ def task
18
+ version = bump(read_version)
19
+ write_version version
20
+
21
+ version
22
+ end
23
+
24
+ protected
25
+
26
+ def git
27
+ @git ||= Git.open ENV['PWD']
28
+ end
29
+
30
+ def version_file(mode = 'r')
31
+ File.open('VERSION', mode) do |f|
32
+ yield f
33
+ end
34
+ end
35
+
36
+ def read_version
37
+ version_file { |f| f.read.strip }
38
+ end
39
+
40
+ def bump(old_version)
41
+ new_version = Anvil::Versioner.new(old_version).bump! term
42
+ logger.info "Bumped from #{old_version} to #{new_version}"
43
+
44
+ new_version
45
+ end
46
+
47
+ def commit_and_tag(version)
48
+ git.add 'VERSION'
49
+ git.commit "Bump version v#{version}"
50
+ git.add_tag "v#{version}"
51
+ end
52
+
53
+ def write_version(version)
54
+ version_file('w+') do |f|
55
+ f.puts version
56
+ f.close
57
+ end
58
+
59
+ commit_and_tag version
60
+ end
61
+ end
@@ -0,0 +1,47 @@
1
+ require 'anvil/task'
2
+ require 'anvil/rubygems'
3
+
4
+ class Gem::ReleaseTask < Anvil::Task
5
+ description 'Builds a new version and pushes it to rubygems'
6
+
7
+ parser do
8
+ arguments %w[bump_term]
9
+
10
+ on('-i', '--[no-]install', 'Install gem') do |i|
11
+ options[:install] = i
12
+ end
13
+ end
14
+
15
+ attr_reader :bump_term, :options
16
+
17
+ def initialize(bump_term, options = {})
18
+ @bump_term = bump_term
19
+ @options = options
20
+ end
21
+
22
+ def task
23
+ version = bump
24
+ gem_file = build
25
+
26
+ push gem_file, version
27
+ end
28
+
29
+ protected
30
+
31
+ def gemspec_file
32
+ Dir['*.gemspec'].first
33
+ end
34
+
35
+ def bump
36
+ Gem::BumpTask.new(bump_term).task
37
+ end
38
+
39
+ def build
40
+ Gem::BuildTask.new(gemspec_file, options).task
41
+ end
42
+
43
+ def push(gem_file, version)
44
+ logger.info "Pushing version #{version} to rubygems"
45
+ Anvil::Rubygems.push gem_file
46
+ end
47
+ end
File without changes
@@ -1,8 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Anvil::DirectoryAssure do
3
+ describe Anvil::DirectoryAssure, fakefs: true do
4
4
  context 'with an existing directory' do
5
5
  before { FileUtils.mkdir('dummy_dir') }
6
+ after { FileUtils.rm_rf('dummy_dir') }
6
7
 
7
8
  it { should be_assured('dummy_dir') }
8
9
  end
@@ -13,6 +14,7 @@ describe Anvil::DirectoryAssure do
13
14
 
14
15
  context 'with a file' do
15
16
  before { FileUtils.touch('dummy_file') }
17
+ after { FileUtils.rm_rf('dummy_file') }
16
18
 
17
19
  it { should_not be_assured('dummy_file') }
18
20
  end
@@ -1,8 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Anvil::FileAssure do
3
+ describe Anvil::FileAssure, fakefs: true do
4
4
  context 'with an existing file' do
5
5
  before { FileUtils.touch 'dummy_file.txt' }
6
+ after { FileUtils.rm 'dummy_file.txt' }
6
7
 
7
8
  it { should be_assured('dummy_file.txt') }
8
9
  end
File without changes
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Anvil::Config do
3
+ describe Anvil::Config, fakefs: true do
4
4
  subject { Anvil::Config }
5
5
  before { Anvil::Config.reset }
6
6
 
File without changes
File without changes
@@ -10,7 +10,7 @@ describe Anvil::TaskManager do
10
10
  end
11
11
 
12
12
  describe '.files_from_current_project' do
13
- let(:gemfile_path) { File.dirname(Bundler::SharedHelpers.default_gemfile) }
13
+ let(:gemfile_path) { described_class.current_project_path }
14
14
  let(:project_task_path) { gemfile_path + '/lib/anvil/' }
15
15
 
16
16
  it 'returns the task files in the path' do
File without changes
@@ -0,0 +1,46 @@
1
+ require 'spec_helper'
2
+ require 'anvil/versioner'
3
+
4
+ describe Anvil::Versioner do
5
+ subject { described_class.new('1.2.3-alpha.1+build.2') }
6
+
7
+ describe '#major!' do
8
+ it 'bumps the major version and resets the others' do
9
+ subject.major!.should == '2.0.0'
10
+ end
11
+ end
12
+
13
+ describe '#minor!' do
14
+ it 'bumps minor term and resets patch, pre and build' do
15
+ subject.minor!.should == '1.3.0'
16
+ end
17
+ end
18
+
19
+ describe '#patch!' do
20
+ it 'bumps the patch term and resets the pre and build' do
21
+ subject.patch!.should == '1.2.4'
22
+ end
23
+ end
24
+
25
+ describe '#pre' do
26
+ it 'bumps the pre-release version and resets the build' do
27
+ subject.pre!.should == '1.2.3-alpha.2'
28
+ end
29
+ end
30
+
31
+ describe '#build!' do
32
+ it 'bumps the build version' do
33
+ subject.build!.should == '1.2.3-alpha.1+build.3'
34
+ end
35
+ end
36
+
37
+ describe '#increment!' do
38
+ context 'if the term doesnt exist' do
39
+ it 'raise an exception' do
40
+ expect do
41
+ subject.bump!(:foo)
42
+ end.to raise_error(Anvil::Versioner::NotSupportedTerm)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
- require 'tasks/gem_build_task'
2
+ require 'tasks/gem/build_task'
3
3
 
4
- describe GemBuildTask do
4
+ describe Gem::BuildTask do
5
5
  let(:output) do
6
6
  <<-END
7
7
  Successfully built RubyGem
@@ -13,7 +13,7 @@ describe GemBuildTask do
13
13
  let(:gemspec_file) { 'anvil.gemspec' }
14
14
  let(:options) { {} }
15
15
 
16
- subject { GemBuildTask.new(gemspec_file, options) }
16
+ subject { Gem::BuildTask.new(gemspec_file, options) }
17
17
 
18
18
  describe '#task' do
19
19
  before do
@@ -45,7 +45,7 @@ describe GemBuildTask do
45
45
  end
46
46
  end
47
47
 
48
- describe '#build_gem' do
48
+ describe '#build_gem', fakefs: true do
49
49
  let(:gem_file) { 'alfred.gem' }
50
50
 
51
51
  before do
@@ -72,8 +72,8 @@ describe GemBuildTask do
72
72
  let(:arguments) { ['anvil.gem', '--install'] }
73
73
 
74
74
  it 'returns the correct arguments' do
75
- expect(GemBuildTask.parse_options!(arguments))
76
- .to be_eql(['anvil.gem', { install: true }])
75
+ expect(Gem::BuildTask.parse_options!(arguments))
76
+ .to be_eql(['anvil.gem', { install: true }])
77
77
  end
78
78
  end
79
79
 
@@ -81,8 +81,8 @@ describe GemBuildTask do
81
81
  let(:arguments) { ['anvil.gem', '--no-install'] }
82
82
 
83
83
  it 'returns the correct arguments' do
84
- expect(GemBuildTask.parse_options!(arguments))
85
- .to be_eql(['anvil.gem', { install: false }])
84
+ expect(Gem::BuildTask.parse_options!(arguments))
85
+ .to be_eql(['anvil.gem', { install: false }])
86
86
  end
87
87
  end
88
88
  end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+ require 'tasks/gem/bump_task'
3
+
4
+ describe Gem::BumpTask do
5
+ describe '#task' do
6
+ subject { Gem::BumpTask.new :major }
7
+ before { subject.stub(:read_version).and_return('2.0.0') }
8
+
9
+ it 'bumps the version and writes it' do
10
+ expect(subject).to receive(:write_version)
11
+
12
+ expect(subject.task).to eq('3.0.0')
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+ require 'anvil/versioner'
3
+ require 'tasks/gem/release_task'
4
+
5
+ describe Gem::ReleaseTask do
6
+ subject { Gem::ReleaseTask.new :major }
7
+
8
+ let(:version) { Anvil::Versioner.new('2.0.0') }
9
+ let(:gem_file) { 'new-gem-v2.0.0.gem' }
10
+
11
+ describe '#task' do
12
+ before do
13
+ subject.stub(:bump).and_return(version)
14
+ subject.stub(:build).and_return(gem_file)
15
+ end
16
+
17
+ it 'pushes the gem to rubygems' do
18
+ subject.should_receive(:push).with(gem_file, version)
19
+ end
20
+
21
+ after { subject.task }
22
+ end
23
+ end
data/spec/spec_helper.rb CHANGED
@@ -5,7 +5,6 @@
5
5
  #
6
6
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
7
 
8
- require 'byebug'
9
8
  require 'fakefs/spec_helpers'
10
9
  require 'anvil'
11
10
 
@@ -22,5 +21,7 @@ RSpec.configure do |config|
22
21
  # the seed, which is printed after each run.
23
22
  # --seed 1234
24
23
  config.order = 'random'
25
- config.include FakeFS::SpecHelpers
24
+ config.before(:all) do
25
+ Anvil.module_eval { @logger = Logger.new(nil) }
26
+ end
26
27
  end
@@ -1,4 +1,6 @@
1
1
  shared_context 'init anvil config', config: true do
2
+ include_context 'with FakeFS'
3
+
2
4
  let(:test_config_path) do
3
5
  File.expand_path('./spec/support/dot_anvil', File.dirname(__FILE__))
4
6
  end
@@ -0,0 +1,4 @@
1
+ shared_context 'with FakeFS', fakefs: true do
2
+ before { FakeFS.activate! }
3
+ after { FakeFS.deactivate! }
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anvil-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha.1
4
+ version: 0.0.1.pre.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fran Casas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-27 00:00:00.000000000 Z
12
+ date: 2014-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: git
@@ -68,47 +68,47 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0.5'
70
70
  - !ruby/object:Gem::Dependency
71
- name: bundler
71
+ name: semantic
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '1.5'
77
- type: :development
76
+ version: '1.3'
77
+ type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '1.5'
83
+ version: '1.3'
84
84
  - !ruby/object:Gem::Dependency
85
- name: rspec
85
+ name: bundler
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '2.14'
90
+ version: '1.5'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '2.14'
97
+ version: '1.5'
98
98
  - !ruby/object:Gem::Dependency
99
- name: byebug
99
+ name: rspec
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '2.6'
104
+ version: '2.14'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '2.6'
111
+ version: '2.14'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: fakefs
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -146,13 +146,11 @@ executables:
146
146
  extensions: []
147
147
  extra_rdoc_files: []
148
148
  files:
149
- - ".gitignore"
150
- - ".travis.yml"
151
149
  - Gemfile
152
150
  - LICENSE.txt
153
151
  - README.md
154
152
  - Rakefile
155
- - anvil-core.gemspec
153
+ - VERSION
156
154
  - bin/anvil
157
155
  - lib/anvil.rb
158
156
  - lib/anvil/assure.rb
@@ -170,21 +168,27 @@ files:
170
168
  - lib/anvil/task/repositories.rb
171
169
  - lib/anvil/task_manager.rb
172
170
  - lib/anvil/version.rb
171
+ - lib/anvil/versioner.rb
173
172
  - lib/gem_ext/mixlib.rb
174
- - lib/tasks/gem_build_task.rb
173
+ - lib/tasks/gem/build_task.rb
174
+ - lib/tasks/gem/bump_task.rb
175
+ - lib/tasks/gem/release_task.rb
175
176
  - lib/tasks/help_task.rb
176
177
  - lib/tasks/projects/add_task.rb
177
178
  - lib/tasks/projects/list_task.rb
178
- - spec/lib/assure_spec.rb
179
- - spec/lib/assures/directory_assure_spec.rb
180
- - spec/lib/assures/file_assure_spec.rb
181
- - spec/lib/cli_spec.rb
182
- - spec/lib/config_spec.rb
183
- - spec/lib/task/naming_spec.rb
184
- - spec/lib/task/options_spec.rb
185
- - spec/lib/task_manager_spec.rb
186
- - spec/lib/task_spec.rb
187
- - spec/lib/tasks/gem_build_task_spec.rb
179
+ - spec/lib/anvil/assure_spec.rb
180
+ - spec/lib/anvil/assures/directory_assure_spec.rb
181
+ - spec/lib/anvil/assures/file_assure_spec.rb
182
+ - spec/lib/anvil/cli_spec.rb
183
+ - spec/lib/anvil/config_spec.rb
184
+ - spec/lib/anvil/task/naming_spec.rb
185
+ - spec/lib/anvil/task/options_spec.rb
186
+ - spec/lib/anvil/task_manager_spec.rb
187
+ - spec/lib/anvil/task_spec.rb
188
+ - spec/lib/anvil/versioner_spec.rb
189
+ - spec/lib/tasks/gem/build_task_spec.rb
190
+ - spec/lib/tasks/gem/bump_task_spec.rb
191
+ - spec/lib/tasks/gem/release_task_spec.rb
188
192
  - spec/lib/tasks/projects/add_task_spec.rb
189
193
  - spec/lib/tasks/projects/list_task_spec.rb
190
194
  - spec/spec_helper.rb
@@ -196,6 +200,7 @@ files:
196
200
  - spec/support/fixtures/dummy_task.rb
197
201
  - spec/support/fixtures/foo/dummy_task.rb
198
202
  - spec/support/shared/config_context.rb
203
+ - spec/support/shared/fake_fs_context.rb
199
204
  homepage: http://github.com/anvil-src/anvil-core
200
205
  licenses:
201
206
  - MIT
@@ -222,16 +227,19 @@ specification_version: 4
222
227
  summary: Anvil is a tool for building tools. A tool that a real craftsmen uses to
223
228
  build its tools.
224
229
  test_files:
225
- - spec/lib/assure_spec.rb
226
- - spec/lib/assures/directory_assure_spec.rb
227
- - spec/lib/assures/file_assure_spec.rb
228
- - spec/lib/cli_spec.rb
229
- - spec/lib/config_spec.rb
230
- - spec/lib/task/naming_spec.rb
231
- - spec/lib/task/options_spec.rb
232
- - spec/lib/task_manager_spec.rb
233
- - spec/lib/task_spec.rb
234
- - spec/lib/tasks/gem_build_task_spec.rb
230
+ - spec/lib/anvil/assure_spec.rb
231
+ - spec/lib/anvil/assures/directory_assure_spec.rb
232
+ - spec/lib/anvil/assures/file_assure_spec.rb
233
+ - spec/lib/anvil/cli_spec.rb
234
+ - spec/lib/anvil/config_spec.rb
235
+ - spec/lib/anvil/task/naming_spec.rb
236
+ - spec/lib/anvil/task/options_spec.rb
237
+ - spec/lib/anvil/task_manager_spec.rb
238
+ - spec/lib/anvil/task_spec.rb
239
+ - spec/lib/anvil/versioner_spec.rb
240
+ - spec/lib/tasks/gem/build_task_spec.rb
241
+ - spec/lib/tasks/gem/bump_task_spec.rb
242
+ - spec/lib/tasks/gem/release_task_spec.rb
235
243
  - spec/lib/tasks/projects/add_task_spec.rb
236
244
  - spec/lib/tasks/projects/list_task_spec.rb
237
245
  - spec/spec_helper.rb
@@ -243,3 +251,4 @@ test_files:
243
251
  - spec/support/fixtures/dummy_task.rb
244
252
  - spec/support/fixtures/foo/dummy_task.rb
245
253
  - spec/support/shared/config_context.rb
254
+ - spec/support/shared/fake_fs_context.rb
data/.gitignore DELETED
@@ -1,20 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- vendor
19
- .rspec
20
- .ruby-version
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.0
4
- - 2.0.0
data/anvil-core.gemspec DELETED
@@ -1,35 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'anvil/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'anvil-core'
8
- spec.version = Anvil::VERSION
9
- spec.authors = ['Fran Casas', 'Jon de Andres']
10
- spec.email = %w(nflamel@otrobloggeek.com jondeandres@gmail.com)
11
- spec.description = 'Anvil is a tool for building tools.'
12
- spec.summary = <<SUMMARY
13
- Anvil is a tool for building tools. A tool that a real craftsmen uses to build its tools.
14
- SUMMARY
15
- spec.homepage = 'http://github.com/anvil-src/anvil-core'
16
- spec.license = 'MIT'
17
-
18
- spec.files = `git ls-files -z`.split("\x0")
19
- spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
20
- spec.test_files = spec.files.grep(/^(test|spec|features)\//)
21
- spec.require_paths = %w(lib)
22
-
23
- # Runtime dependencies
24
- spec.add_runtime_dependency 'git', '~> 1.2'
25
- spec.add_runtime_dependency 'activesupport', '~> 4.0'
26
- spec.add_runtime_dependency 'mixlib-config', '~> 2.1'
27
- spec.add_runtime_dependency 'cocaine', '~> 0.5'
28
-
29
- # Development dependencies
30
- spec.add_development_dependency 'bundler', '~> 1.5'
31
- spec.add_development_dependency 'rspec', '~> 2.14'
32
- spec.add_development_dependency 'byebug', '~> 2.6'
33
- spec.add_development_dependency 'fakefs', '~> 0.5'
34
- spec.add_development_dependency 'rubocop', '~> 0.18'
35
- end