rubygems-isit19 1.0
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.tar.gz.sig +2 -0
- data/.autotest +23 -0
- data/History.txt +5 -0
- data/Manifest.txt +8 -0
- data/README.txt +54 -0
- data/Rakefile +16 -0
- data/lib/isit19.rb +98 -0
- data/lib/rubygems/commands/isit19_command.rb +74 -0
- data/lib/rubygems_plugin.rb +41 -0
- metadata +109 -0
- metadata.gz.sig +3 -0
data.tar.gz.sig
ADDED
data/.autotest
ADDED
@@ -0,0 +1,23 @@
|
|
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/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
= rubygems-isit19
|
2
|
+
|
3
|
+
* http://isitruby19.com
|
4
|
+
* http://seattlerb.rubyforge.org/rubygems-isit19
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
Lets you figure out if your gems and gems you install might work on 1.9. Uses
|
9
|
+
http://isitruby19.com as its datastore. Be sure to update the website with
|
10
|
+
your experiences!
|
11
|
+
|
12
|
+
== FEATURES/PROBLEMS:
|
13
|
+
|
14
|
+
* gem isit19 for checking your installed gems
|
15
|
+
* gem install plugin that tells you if your installed gem works on 1.9
|
16
|
+
|
17
|
+
== SYNOPSIS:
|
18
|
+
|
19
|
+
$ gem install ZenTest
|
20
|
+
|
21
|
+
ZenTest 4.1.4 might work, 100% say 4.1.3 works on 1.9
|
22
|
+
Update http://isitruby19.com/ZenTest with your experiences!
|
23
|
+
|
24
|
+
Successfully installed ZenTest-4.1.4
|
25
|
+
1 gem installed
|
26
|
+
|
27
|
+
== INSTALL:
|
28
|
+
|
29
|
+
* sudo gem install rubygems-isit19
|
30
|
+
|
31
|
+
== LICENSE:
|
32
|
+
|
33
|
+
(The MIT License)
|
34
|
+
|
35
|
+
Copyright (c) 2009 Eric Hodel
|
36
|
+
|
37
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
38
|
+
a copy of this software and associated documentation files (the
|
39
|
+
'Software'), to deal in the Software without restriction, including
|
40
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
41
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
42
|
+
permit persons to whom the Software is furnished to do so, subject to
|
43
|
+
the following conditions:
|
44
|
+
|
45
|
+
The above copyright notice and this permission notice shall be
|
46
|
+
included in all copies or substantial portions of the Software.
|
47
|
+
|
48
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
49
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
50
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
51
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
52
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
53
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
54
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
|
6
|
+
Hoe.plugin :seattlerb
|
7
|
+
|
8
|
+
Hoe.spec 'rubygems-isit19' do
|
9
|
+
developer 'Eric Hodel', 'drbrain@segment7.net'
|
10
|
+
|
11
|
+
self.rubyforge_name = 'seattlerb'
|
12
|
+
|
13
|
+
extra_deps << ['json', '~> 1.1']
|
14
|
+
end
|
15
|
+
|
16
|
+
# vim: syntax=Ruby
|
data/lib/isit19.rb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubygems/remote_fetcher'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
##
|
6
|
+
# Utilities for determining if a Gem::Specification is ruby 1.9 ready. Based
|
7
|
+
# on http://isitruby19.com
|
8
|
+
|
9
|
+
class IsIt19
|
10
|
+
|
11
|
+
##
|
12
|
+
# This version of rubygems-isit19
|
13
|
+
|
14
|
+
VERSION = '1.0'
|
15
|
+
|
16
|
+
##
|
17
|
+
# Comments for this gem
|
18
|
+
|
19
|
+
attr_reader :comments
|
20
|
+
|
21
|
+
##
|
22
|
+
# The gemspec
|
23
|
+
|
24
|
+
attr_reader :spec
|
25
|
+
|
26
|
+
##
|
27
|
+
# Downloads comments for +spec+ from http://isitruby19.com
|
28
|
+
|
29
|
+
def initialize(spec)
|
30
|
+
@spec = spec
|
31
|
+
|
32
|
+
url = URI.parse "http://isitruby19.com/#{@spec.name}/comments.json"
|
33
|
+
|
34
|
+
json = Gem::RemoteFetcher.fetcher.fetch_path url
|
35
|
+
comments = JSON.parse json
|
36
|
+
|
37
|
+
comments.map! do |comment|
|
38
|
+
begin
|
39
|
+
comment['comment']['version'] =
|
40
|
+
Gem::Version.new comment['comment']['version']
|
41
|
+
comment['comment']
|
42
|
+
rescue ArgumentError # bad data from isitruby19.com
|
43
|
+
next
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
comments.compact!
|
48
|
+
|
49
|
+
@comments = comments.sort_by do |comment|
|
50
|
+
works = comment['works_for_me'] ? 1 : 0
|
51
|
+
[comment['version'], works, comment['name']]
|
52
|
+
end.reverse
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# Strict check for this version
|
57
|
+
|
58
|
+
def one_nine?
|
59
|
+
@comments.any? do |comment|
|
60
|
+
comment['version'] == @spec.version and comment['works_for_me']
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Returns a comment from the latest version that worked with 1.9
|
66
|
+
|
67
|
+
def maybe_one_nine?
|
68
|
+
@comments.first do |comment|
|
69
|
+
comment['works_for_me']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# Returns a percentage of people saying +version+ worked for them
|
75
|
+
|
76
|
+
def percent(version = @spec.version)
|
77
|
+
matching = @comments.select do |comment|
|
78
|
+
comment['version'] == version
|
79
|
+
end
|
80
|
+
|
81
|
+
works = matching.select do |comment| comment['works_for_me'] end.length
|
82
|
+
|
83
|
+
percent = (matching.length.to_f / works * 100)
|
84
|
+
percent = 0 if percent.nan?
|
85
|
+
percent = 100 if percent > 100
|
86
|
+
|
87
|
+
"%2.0f%%" % percent
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# URL of this gem on http://isitruby19.com
|
92
|
+
|
93
|
+
def url
|
94
|
+
"http://isitruby19.com/#{spec.name}"
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'rubygems/command'
|
2
|
+
require 'rubygems/version_option'
|
3
|
+
require 'rubygems/text'
|
4
|
+
require 'isit19'
|
5
|
+
|
6
|
+
##
|
7
|
+
# gem command for querying the 1.9 status of installed gems
|
8
|
+
|
9
|
+
class Gem::Commands::Isit19Command < Gem::Command
|
10
|
+
|
11
|
+
include Gem::VersionOption
|
12
|
+
include Gem::Text
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
super 'isit19', 'Check isitruby19.com for ruby 1.9 compatibility',
|
16
|
+
:version => Gem::Requirement.default
|
17
|
+
|
18
|
+
add_version_option
|
19
|
+
end
|
20
|
+
|
21
|
+
def arguments # :nodoc:
|
22
|
+
'GEMNAME name of an installed gem to check for 1.9 compatibility'
|
23
|
+
end
|
24
|
+
|
25
|
+
def defaults_str # :nodoc:
|
26
|
+
"--version='>= 0'"
|
27
|
+
end
|
28
|
+
|
29
|
+
def usage # :nodoc:
|
30
|
+
"#{program_name} GEMNAME [options]"
|
31
|
+
end
|
32
|
+
|
33
|
+
def execute
|
34
|
+
name = get_one_gem_name
|
35
|
+
|
36
|
+
dep = Gem::Dependency.new name, options[:version]
|
37
|
+
specs = Gem.source_index.search dep
|
38
|
+
|
39
|
+
if specs.empty? then
|
40
|
+
alert_error "No installed gem #{dep}"
|
41
|
+
terminate_interaction 1
|
42
|
+
end
|
43
|
+
|
44
|
+
spec = specs.last
|
45
|
+
|
46
|
+
isit19 = IsIt19.new spec
|
47
|
+
|
48
|
+
comments = isit19.comments
|
49
|
+
|
50
|
+
say "#{spec.name} #{spec.version}: #{isit19.url}"
|
51
|
+
|
52
|
+
say ' No reports!' if comments.empty?
|
53
|
+
|
54
|
+
last_seen_version = nil
|
55
|
+
|
56
|
+
comments.each_with_index do |comment, i|
|
57
|
+
break if i > 0 and comment['version'] != last_seen_version
|
58
|
+
|
59
|
+
works = comment['works_for_me'] ? 'works' : 'fails'
|
60
|
+
platform = comment['platform'].values.join ' ' if comment['platform']
|
61
|
+
|
62
|
+
msg = "#{comment['name']} says #{comment['version']} #{works}"
|
63
|
+
msg << " on #{platform}" if platform
|
64
|
+
|
65
|
+
say " #{msg}"
|
66
|
+
say format_text(comment['body'], 68, 8) unless comment['body'].empty?
|
67
|
+
say
|
68
|
+
|
69
|
+
last_seen_version = comment['version']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rubygems/command_manager'
|
2
|
+
|
3
|
+
Gem::CommandManager.instance.register_command :isit19
|
4
|
+
|
5
|
+
Gem.pre_install do |i| # installer
|
6
|
+
require 'isit19'
|
7
|
+
|
8
|
+
next if i.instance_variable_defined? :@isit19_ran
|
9
|
+
|
10
|
+
i.instance_variable_set :@isit19_ran, true
|
11
|
+
|
12
|
+
spec = i.spec
|
13
|
+
name = "#{spec.name} #{spec.version}"
|
14
|
+
|
15
|
+
begin
|
16
|
+
isit19 = IsIt19.new i.spec
|
17
|
+
rescue Gem::RemoteFetcher::FetchError
|
18
|
+
i.say "uh-oh! unable to fetch data for #{name}, maybe it doesn't exist yet?"
|
19
|
+
i.say "http://isitruby19/#{spec.name}"
|
20
|
+
next
|
21
|
+
end
|
22
|
+
|
23
|
+
i.say
|
24
|
+
|
25
|
+
if isit19.one_nine? then
|
26
|
+
i.say "#{name} is #{isit19.percent} verified 1.9"
|
27
|
+
else
|
28
|
+
comment = isit19.maybe_one_nine?
|
29
|
+
|
30
|
+
if comment then
|
31
|
+
working = comment['version']
|
32
|
+
i.say "#{name} might work, #{isit19.percent working} say #{working} works on 1.9"
|
33
|
+
else
|
34
|
+
i.say "Nobody has verified #{name} works with 1.9"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
i.say "Update #{isit19.url} with your experiences!"
|
39
|
+
i.say
|
40
|
+
end
|
41
|
+
|
metadata
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubygems-isit19
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: "1.0"
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eric Hodel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0B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W6on70SFPmAy/5Cq0OJNGEWBfgD9q7rrs/X8GGwUWqXb85RXnUVi/P8Up75E0ag
|
29
|
+
14jEc90kN+C7oI/AGCBN0j6JnEtYIEJZibjjDJTSMWlUKKkj30kq7hlUC2CepJ4v
|
30
|
+
x52qPcexcYZR7w==
|
31
|
+
-----END CERTIFICATE-----
|
32
|
+
|
33
|
+
date: 2009-08-19 00:00:00 -07:00
|
34
|
+
default_executable:
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: json
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "1.1"
|
45
|
+
version:
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: hoe
|
48
|
+
type: :development
|
49
|
+
version_requirement:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.3.3
|
55
|
+
version:
|
56
|
+
description: |-
|
57
|
+
Lets you figure out if your gems and gems you install might work on 1.9. Uses
|
58
|
+
http://isitruby19.com as its datastore. Be sure to update the website with
|
59
|
+
your experiences!
|
60
|
+
email:
|
61
|
+
- drbrain@segment7.net
|
62
|
+
executables: []
|
63
|
+
|
64
|
+
extensions: []
|
65
|
+
|
66
|
+
extra_rdoc_files:
|
67
|
+
- History.txt
|
68
|
+
- Manifest.txt
|
69
|
+
- README.txt
|
70
|
+
files:
|
71
|
+
- .autotest
|
72
|
+
- History.txt
|
73
|
+
- Manifest.txt
|
74
|
+
- README.txt
|
75
|
+
- Rakefile
|
76
|
+
- lib/isit19.rb
|
77
|
+
- lib/rubygems/commands/isit19_command.rb
|
78
|
+
- lib/rubygems_plugin.rb
|
79
|
+
has_rdoc: true
|
80
|
+
homepage: http://isitruby19.com
|
81
|
+
licenses: []
|
82
|
+
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options:
|
85
|
+
- --main
|
86
|
+
- README.txt
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: "0"
|
94
|
+
version:
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: "0"
|
100
|
+
version:
|
101
|
+
requirements: []
|
102
|
+
|
103
|
+
rubyforge_project: seattlerb
|
104
|
+
rubygems_version: 1.3.5
|
105
|
+
signing_key:
|
106
|
+
specification_version: 3
|
107
|
+
summary: Lets you figure out if your gems and gems you install might work on 1.9
|
108
|
+
test_files: []
|
109
|
+
|
metadata.gz.sig
ADDED