crxmake 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +14 -4
  2. data/lib/crxmake.rb +10 -10
  3. metadata +20 -9
data/Rakefile CHANGED
@@ -75,27 +75,37 @@ task :gemspec do
75
75
  end
76
76
  end
77
77
 
78
+ desc "install"
79
+ task "install" => [:gem] do
80
+ sh "gem install pkg/#{$name}-#{$version}.gem --local"
81
+ end
82
+
78
83
  namespace :install do
79
84
  desc "install 1.8"
80
85
  task "1.8" => [:gem] do
81
- sh "sudo gem1.8 install pkg/#{$name}-#{$version}.gem --local"
86
+ sh "gem1.8 install pkg/#{$name}-#{$version}.gem --local"
82
87
  end
83
88
 
84
89
  desc "install 1.9"
85
90
  task "1.9" => [:gem] do
86
- sh "sudo gem1.9 install pkg/#{$name}-#{$version}.gem --local"
91
+ sh "gem1.9 install pkg/#{$name}-#{$version}.gem --local"
87
92
  end
88
93
  end
89
94
 
95
+ desc "uninstall"
96
+ task "uninstall" do
97
+ sh "gem uninstall #{$name}"
98
+ end
99
+
90
100
  namespace :uninstall do
91
101
  desc "uninstall 1.8"
92
102
  task "1.8" do
93
- sh "sudo gem1.8 uninstall #{$name}"
103
+ sh "gem1.8 uninstall #{$name}"
94
104
  end
95
105
 
96
106
  desc "uninstall 1.9"
97
107
  task "1.9" do
98
- sh "sudo gem1.9 uninstall #{$name}"
108
+ sh "gem1.9 uninstall #{$name}"
99
109
  end
100
110
  end
101
111
 
data/lib/crxmake.rb CHANGED
@@ -9,16 +9,16 @@ require 'find'
9
9
  require 'pathname'
10
10
 
11
11
  class CrxMake < Object
12
- VERSION = '2.0.2'
12
+ VERSION = '2.0.3'
13
13
  # thx masover
14
- @@magic = 'Cr24'
14
+ MAGIC = 'Cr24'
15
15
 
16
16
  # this is chromium extension version
17
- @@version = [2].pack('L')
17
+ EXT_VERSION = [2].pack('V')
18
18
 
19
19
  # CERT_PUBLIC_KEY_INFO struct
20
- @@key_algo = %w(30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00 03 81 8D 00).map{|s| s.hex}.pack('C*')
21
- @@key_size = 1024
20
+ KEY = %w(30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00 03 81 8D 00).map{|s| s.hex}.pack('C*')
21
+ KEY_SIZE = 1024
22
22
 
23
23
  def initialize opt
24
24
  @opt = opt
@@ -141,7 +141,7 @@ ext dir: \"#{@exdir}\"
141
141
 
142
142
  def generate_key
143
143
  puts "generate pemkey to \"#{@pkey_o}\"" if @verbose
144
- @key = OpenSSL::PKey::RSA.generate(@@key_size)
144
+ @key = OpenSSL::PKey::RSA.generate(KEY_SIZE)
145
145
  # save key
146
146
  File.open(@pkey_o, 'wb') do |file|
147
147
  file << @key.export()
@@ -194,10 +194,10 @@ zip file at \"#{@zip}\"
194
194
 
195
195
  def write_crx
196
196
  print "write crx..." if @verbose
197
- key = @@key_algo+@key.public_key.to_der
197
+ key = KEY+@key.public_key.to_der
198
198
  File.open(@crx, 'wb') do |file|
199
- file << @@magic
200
- file << @@version
199
+ file << MAGIC
200
+ file << EXT_VERSION
201
201
  file << to_sizet(key.size)
202
202
  file << to_sizet(@sig.size)
203
203
  file << key
@@ -210,7 +210,7 @@ zip file at \"#{@zip}\"
210
210
  end
211
211
 
212
212
  def to_sizet num
213
- return [num].pack('L')
213
+ return [num].pack('V')
214
214
  end
215
215
 
216
216
  def final
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crxmake
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 0
8
+ - 3
9
+ version: 2.0.3
5
10
  platform: ruby
6
11
  authors:
7
12
  - Constellation
@@ -9,19 +14,23 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-12-04 00:00:00 +09:00
17
+ date: 2010-04-28 00:00:00 +09:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: zipruby
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 3
30
+ - 2
23
31
  version: 0.3.2
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  description: make chromium extension
26
35
  email: utatane.tea@gmail.com
27
36
  executables:
@@ -54,18 +63,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
63
  requirements:
55
64
  - - ">="
56
65
  - !ruby/object:Gem::Version
66
+ segments:
67
+ - 0
57
68
  version: "0"
58
- version:
59
69
  required_rubygems_version: !ruby/object:Gem::Requirement
60
70
  requirements:
61
71
  - - ">="
62
72
  - !ruby/object:Gem::Version
73
+ segments:
74
+ - 0
63
75
  version: "0"
64
- version:
65
76
  requirements: []
66
77
 
67
78
  rubyforge_project: crxmake
68
- rubygems_version: 1.3.5
79
+ rubygems_version: 1.3.6
69
80
  signing_key:
70
81
  specification_version: 3
71
82
  summary: make chromium extension