update_hints 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Gemfile +7 -0
- data/History.txt +7 -3
- data/Rakefile +23 -8
- data/lib/update_hints.rb +52 -16
- data/test/rails_versions.xml +1843 -0
- data/test/sample.xml +1110 -34
- data/test/test_update_hints.rb +13 -4
- data/update_hints.gemspec +53 -0
- metadata +77 -56
- data/.autotest +0 -23
- data/.gemtest +0 -0
- data/Manifest.txt +0 -8
data/test/test_update_hints.rb
CHANGED
@@ -12,18 +12,27 @@ class TestUpdateHints < Test::Unit::TestCase
|
|
12
12
|
def test_version_check_properly_output
|
13
13
|
xml = File.open(File.dirname(__FILE__) + "/sample.xml")
|
14
14
|
output = ''
|
15
|
-
flexmock(UpdateHints).should_receive(:open).with("http://rubygems.org/api/v1/
|
15
|
+
flexmock(UpdateHints::Checker).new_instances.should_receive(:open).with("http://rubygems.org/api/v1/versions/tracksperanto.xml").once.and_return(xml)
|
16
16
|
|
17
17
|
UpdateHints.version_check("tracksperanto", "1.2.3", output)
|
18
|
-
assert_equal "Your version of tracksperanto is probably out of date\n(the current version is 2.
|
18
|
+
assert_equal "Your version of tracksperanto is probably out of date\n(the current version is 3.2.2, but you have 1.2.3).\nPlease consider updating (run `gem update tracksperanto`)\n", output
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_version_check_stays_silent_on_success
|
22
22
|
xml = File.open(File.dirname(__FILE__) + "/sample.xml")
|
23
23
|
output = ''
|
24
|
-
flexmock(UpdateHints).should_receive(:open).with("http://rubygems.org/api/v1/
|
25
|
-
UpdateHints.version_check("tracksperanto", "2.
|
24
|
+
flexmock(UpdateHints::Checker).new_instances.should_receive(:open).with("http://rubygems.org/api/v1/versions/tracksperanto.xml").once.and_return(xml)
|
25
|
+
UpdateHints.version_check("tracksperanto", "3.2.2", output)
|
26
26
|
assert_equal "", output
|
27
27
|
end
|
28
28
|
|
29
|
+
def test_sorts_proper_rails_gem_on_top
|
30
|
+
xml = File.open(File.dirname(__FILE__) + "/rails_versions.xml")
|
31
|
+
output = ''
|
32
|
+
flexmock(UpdateHints::Checker).new_instances.should_receive(:open).with("http://rubygems.org/api/v1/versions/rails.xml").once.and_return(xml)
|
33
|
+
# Latest version released is 2.38.1 but the latest release gem is 3.2.2. It also has 4.0.0.pre which is perfect for our test
|
34
|
+
UpdateHints.version_check("rails", "3.1.0", output)
|
35
|
+
assert_equal "Your version of rails is probably out of date\n(the current version is 3.2.13, but you have 3.1.0).\nPlease consider updating (run `gem update rails`)\n", output
|
36
|
+
end
|
37
|
+
|
29
38
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "update_hints"
|
8
|
+
s.version = "1.0.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Julik Tarkhanov"]
|
12
|
+
s.date = "2013-03-22"
|
13
|
+
s.email = "me@julik.nl"
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"README.rdoc"
|
16
|
+
]
|
17
|
+
s.files = [
|
18
|
+
".travis.yml",
|
19
|
+
"Gemfile",
|
20
|
+
"History.txt",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"lib/update_hints.rb",
|
24
|
+
"test/rails_versions.xml",
|
25
|
+
"test/sample.xml",
|
26
|
+
"test/test_update_hints.rb",
|
27
|
+
"update_hints.gemspec"
|
28
|
+
]
|
29
|
+
s.homepage = "http://github.com/julik/update_hints"
|
30
|
+
s.licenses = ["MIT"]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubygems_version = "1.8.24"
|
33
|
+
s.summary = "Automatically check if a new version of your gem is available and notify users"
|
34
|
+
|
35
|
+
if s.respond_to? :specification_version then
|
36
|
+
s.specification_version = 3
|
37
|
+
|
38
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
39
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
40
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
41
|
+
s.add_development_dependency(%q<flexmock>, ["~> 0.8"])
|
42
|
+
else
|
43
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
44
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
45
|
+
s.add_dependency(%q<flexmock>, ["~> 0.8"])
|
46
|
+
end
|
47
|
+
else
|
48
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
49
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
50
|
+
s.add_dependency(%q<flexmock>, ["~> 0.8"])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
metadata
CHANGED
@@ -1,87 +1,108 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: update_hints
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
4
5
|
prerelease:
|
5
|
-
version: 1.0.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Julik Tarkhanov
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: jeweler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
17
23
|
prerelease: false
|
18
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
25
|
none: false
|
20
|
-
requirements:
|
21
|
-
- -
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
24
38
|
type: :development
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: hoe
|
28
39
|
prerelease: false
|
29
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: flexmock
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
30
49
|
none: false
|
31
|
-
requirements:
|
50
|
+
requirements:
|
32
51
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.8'
|
35
54
|
type: :development
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.8'
|
62
|
+
description:
|
63
|
+
email: me@julik.nl
|
40
64
|
executables: []
|
41
|
-
|
42
65
|
extensions: []
|
43
|
-
|
44
|
-
extra_rdoc_files:
|
45
|
-
- History.txt
|
46
|
-
- Manifest.txt
|
66
|
+
extra_rdoc_files:
|
47
67
|
- README.rdoc
|
48
|
-
files:
|
49
|
-
- .
|
68
|
+
files:
|
69
|
+
- .travis.yml
|
70
|
+
- Gemfile
|
50
71
|
- History.txt
|
51
|
-
- Manifest.txt
|
52
72
|
- README.rdoc
|
53
73
|
- Rakefile
|
54
74
|
- lib/update_hints.rb
|
75
|
+
- test/rails_versions.xml
|
55
76
|
- test/sample.xml
|
56
77
|
- test/test_update_hints.rb
|
57
|
-
- .
|
78
|
+
- update_hints.gemspec
|
58
79
|
homepage: http://github.com/julik/update_hints
|
59
|
-
licenses:
|
60
|
-
|
80
|
+
licenses:
|
81
|
+
- MIT
|
61
82
|
post_install_message:
|
62
|
-
rdoc_options:
|
63
|
-
|
64
|
-
- README.rdoc
|
65
|
-
require_paths:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
66
85
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
87
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version:
|
73
|
-
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
hash: 796897953041020195
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
96
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
79
101
|
requirements: []
|
80
|
-
|
81
|
-
|
82
|
-
rubygems_version: 1.8.5
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 1.8.24
|
83
104
|
signing_key:
|
84
105
|
specification_version: 3
|
85
|
-
summary:
|
86
|
-
|
87
|
-
|
106
|
+
summary: Automatically check if a new version of your gem is available and notify
|
107
|
+
users
|
108
|
+
test_files: []
|
data/.autotest
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
require 'autotest/restart'
|
4
|
-
|
5
|
-
# Autotest.add_hook :initialize do |at|
|
6
|
-
# at.extra_files << "../some/external/dependency.rb"
|
7
|
-
#
|
8
|
-
# at.libs << ":../some/external"
|
9
|
-
#
|
10
|
-
# at.add_exception 'vendor'
|
11
|
-
#
|
12
|
-
# at.add_mapping(/dependency.rb/) do |f, _|
|
13
|
-
# at.files_matching(/test_.*rb$/)
|
14
|
-
# end
|
15
|
-
#
|
16
|
-
# %w(TestA TestB).each do |klass|
|
17
|
-
# at.extra_class_map[klass] = "test/test_misc.rb"
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
|
21
|
-
# Autotest.add_hook :run_command do |at|
|
22
|
-
# system "rake build"
|
23
|
-
# end
|
data/.gemtest
DELETED
File without changes
|