up_to_date 0.0.1

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.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ #ignore built gems
2
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in up_to_date.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,16 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ up_to_date (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.0.4)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ rake (~> 10.0.3)
16
+ up_to_date!
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Symmetric Infinity
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ ## Purpose
2
+
3
+ Keep your gems up to date with a rake task. up_to_date will `bundle update`
4
+ each outdated gem that appears in your Gemfile, run the default rake task for
5
+ your project, and if they pass commit the changes to your Gemfile.lock to the
6
+ project's git repository.
7
+
8
+ ## Caveats
9
+ This is alpha.
10
+
11
+ There currently aren't any tests in place. Running the update task is going to
12
+ make commits to your local git repository. If you don't have good coverage for
13
+ things that get updated, up_to_date can't figure that out. This is designed to
14
+ take the bulk of the work out of keeping your gems up to date. Some manual work
15
+ may still be required.
16
+
17
+ ## Installation
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ gem 'up_to_date'
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Or install it yourself as:
28
+
29
+ $ gem install up_to_date
30
+
31
+ ## Usage
32
+
33
+ $ rake deps:outdated
34
+ $ rake deps:update
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it
39
+ 1. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 1. Write tests for your feature
41
+ 1. Commit your changes (`git commit -am 'Add some feature'`)
42
+ 1. Push to the branch (`git push origin my-new-feature`)
43
+ 1. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "rake/testtask"
2
+ require "bundler/gem_tasks"
3
+
4
+ task default: :test
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.libs << 'lib' << 'spec'
8
+ t.test_files = Dir["spec/**/*_spec.rb"]
9
+ t.verbose = true
10
+ end
11
+
@@ -0,0 +1,44 @@
1
+ namespace :deps do
2
+
3
+ def intersection
4
+ return @outdated if @outdated
5
+ @outdated = `bundle outdated` # run bundle outdated
6
+ @outdated = @outdated.split("\n").select{|line| line.include?("*")} # all the gems in the Gemfile.lock that are outdated
7
+ @outdated = @outdated.map{|gem| gem.match(/\* ([a-zA-Z0-9_-]+) /)[1]} # remove everything from the entry that isn't the gem's name
8
+
9
+ app_gems = File.readlines("Gemfile").select{|line| line.include?("gem ")} #all the gems in the Gemfile
10
+ app_gems = app_gems.map{|gem| gem.match(/gem '([a-zA-Z0-9_-]+)/)[1]} # remove everything from the entry that isn't the gem's name
11
+
12
+ @outdated = @outdated.select{|outdated_gem| app_gems.include?(outdated_gem)} #select the gems that are outdated that also appear in the Gemfile
13
+ end
14
+
15
+ desc "Update each gem in 'bundle outdated' if it also appears in the Gemfile and run rake after each update"
16
+ task :update do
17
+ if intersection.any?
18
+ puts "Outdated gems that we depend on:\n#{intersection.join("\n")}\n"
19
+ intersection.each do |gem|
20
+ puts "Updating #{gem}"
21
+ puts `bundle update #{gem}`
22
+ puts `bundle exec rake`
23
+ if $? == 0
24
+ puts `git add Gemfile.lock`
25
+ puts `git commit -m "update #{gem} gem"`
26
+ else
27
+ puts "The tests failed for gem: #{gem}"
28
+ puts `git checkout Gemfile.lock`
29
+ end
30
+ end
31
+ else
32
+ puts "Nothing outdated."
33
+ end
34
+ end
35
+
36
+ desc "Show the gems from 'bundle outdated' that also appear in the Gemfile"
37
+ task :outdated do
38
+ if intersection.any?
39
+ puts "Outdated gems that we depend on:\n#{intersection.join("\n")}\n"
40
+ else
41
+ puts "Nothing outdated."
42
+ end
43
+ end
44
+ end
data/lib/up_to_date.rb ADDED
@@ -0,0 +1,7 @@
1
+ # up_to_date
2
+
3
+ # if we're being required in an environment with rake
4
+ # load the gem's tasks
5
+ if defined?(Rake)
6
+ load 'tasks/up_to_date.rake'
7
+ end
data/spec/.gitkeep ADDED
File without changes
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "up_to_date"
7
+ gem.version = "0.0.1"
8
+ gem.authors = ["Stefan Natchev", "Adam Duke"]
9
+ gem.email = ["stefan.natchev@gmail.com", "adam.v.duke@gmail.com"]
10
+ gem.summary = "A gem for keeping your gems up to date"
11
+ gem.description = "up_to_date contains a rake task that you can use to keep your gems up to date."
12
+ gem.homepage = "http://github.com/SymmetricInfinity/up_to_date"
13
+
14
+ gem.files = `git ls-files`.split($/)
15
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
+ gem.require_paths = ["lib"]
18
+ gem.required_ruby_version = '>= 1.9'
19
+
20
+ gem.add_development_dependency 'rake', '~> 10.0.3'
21
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: up_to_date
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Stefan Natchev
9
+ - Adam Duke
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-08-15 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 10.0.3
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: 10.0.3
31
+ description: up_to_date contains a rake task that you can use to keep your gems up
32
+ to date.
33
+ email:
34
+ - stefan.natchev@gmail.com
35
+ - adam.v.duke@gmail.com
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - .gitignore
41
+ - Gemfile
42
+ - Gemfile.lock
43
+ - LICENSE.txt
44
+ - README.md
45
+ - Rakefile
46
+ - lib/tasks/up_to_date.rake
47
+ - lib/up_to_date.rb
48
+ - spec/.gitkeep
49
+ - up_to_date.gemspec
50
+ homepage: http://github.com/SymmetricInfinity/up_to_date
51
+ licenses: []
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '1.9'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project:
70
+ rubygems_version: 1.8.24
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: A gem for keeping your gems up to date
74
+ test_files:
75
+ - spec/.gitkeep
76
+ has_rdoc: