capcode-render-binary 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -19,46 +19,41 @@ end
19
19
  require 'json/pure'
20
20
  require 'open-uri'
21
21
 
22
- VERS = j.jeweler.version
23
- NAME = j.jeweler.gemspec.name
24
-
25
- class Rubygems
26
- def initialize
27
- url = "http://rubygems.org/api/v1/gems/#{NAME}.json"
28
- @version_at_rubygems = JSON.parse( open(url).read )["version"]
29
- end
22
+ class MyGem
23
+ attr_reader :local_version
24
+ attr_reader :rubygems_version
25
+ attr_reader :name
30
26
 
31
- def status
32
- version == VERS
33
- end
34
- def self.status
35
- self.new.status
27
+ def initialize( version, name )
28
+ @local_version = version
29
+ @name = name
30
+ url = "http://rubygems.org/api/v1/gems/#{@name}.json"
31
+ @rubygems_version = JSON.parse( open(url).read )["version"]
36
32
  end
37
33
 
38
- def version
39
- @version_at_rubygems
40
- end
41
- def self.version
42
- self.new.version
34
+ def status
35
+ @rubygems_version == @local_version
43
36
  end
44
37
  end
45
38
 
39
+ MYGEM = MyGem.new( j.jeweler.version, j.jeweler.gemspec.name )
40
+
46
41
  namespace :gemcutter do
47
42
  desc "push to gemcutter"
48
43
  task :push => [:build] do
49
- unless Rubygems.status
50
- sh %{gem push pkg/#{NAME}-#{VERS}.gem}, :verbose => true
44
+ unless MYGEM.status
45
+ sh %{gem push pkg/#{MYGEM.name}-#{MYGEM.local_version}.gem}, :verbose => true
51
46
  else
52
- puts "This gem already existe in version #{VERS}!"
47
+ puts "This gem already existe in version #{MYGEM.local_version}!"
53
48
  end
54
49
  end
55
50
 
56
51
  desc "check gemcutter status"
57
52
  task :status do
58
- if Rubygems.status
59
- puts "This gem already existe in version #{VERS}!"
53
+ if MYGEM.status
54
+ puts "This gem already existe in version #{MYGEM.local_version}!"
60
55
  else
61
- puts "This gem (#{VERS}) has nos been published! Last version at gemcutter is #{Rubygems.version}"
56
+ puts "This gem (#{MYGEM.name}) has not been pushed! Last version at gemcutter is #{MYGEM.rubygems_version}"
62
57
  end
63
58
  end
64
59
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{capcode-render-binary}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gregoire Lejeune"]
12
- s.date = %q{2010-03-03}
12
+ s.date = %q{2010-04-14}
13
13
  s.description = %q{Capcode plugin to render binary file}
14
14
  s.email = %q{gregoire.lejeune@free.fr}
15
15
  s.extra_rdoc_files = [
@@ -7,7 +7,11 @@ module Capcode
7
7
  @response[k] = v
8
8
  end
9
9
 
10
- self.send(f)
10
+ if self.respond_to?(f.to_sym)
11
+ self.send(f)
12
+ else
13
+ f
14
+ end
11
15
  end
12
16
  end
13
17
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
7
+ - 3
8
8
  - 0
9
- version: 0.2.0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Gregoire Lejeune
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-03 00:00:00 +01:00
17
+ date: 2010-04-14 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20