Constellation-crxmake 1.0.0 → 1.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.
Files changed (2) hide show
  1. data/lib/crxmake.rb +9 -13
  2. metadata +4 -3
data/lib/crxmake.rb CHANGED
@@ -6,9 +6,10 @@ require 'openssl'
6
6
  require 'digest/sha1'
7
7
  require 'fileutils'
8
8
  require 'find'
9
+ require 'pathname'
9
10
 
10
11
  class CrxMake < Object
11
- VERSION = '1.0.0'
12
+ VERSION = '1.0.1'
12
13
  @@magic = [?C, ?r, ?2, ?4].pack('C*')
13
14
  # this is chromium extension version
14
15
  @@version = [2].pack('L')
@@ -68,14 +69,14 @@ class CrxMake < Object
68
69
  end
69
70
  @crx_dir = File.dirname(@crx)
70
71
  puts <<-EOS if @verbose
71
- crx output dir: #{@crxdir}
72
- ext dir: #{@exdir}
72
+ crx output dir: \"#{@crx}\"
73
+ ext dir: \"#{@exdir}\"
73
74
  EOS
74
75
  @zip = File.join(@crx_dir, 'extension.zip')
75
76
  end
76
77
 
77
78
  def read_key
78
- puts "read pemkey, \"#{@pkey}\"" if @verbose
79
+ puts "read pemkey: \"#{@pkey}\"" if @verbose
79
80
  File.open(@pkey, 'rb') do |io|
80
81
  @key = OpenSSL::PKey::RSA.new(io)
81
82
  end
@@ -116,20 +117,15 @@ ext dir: #{@exdir}
116
117
  end
117
118
  puts <<-EOS if @verbose
118
119
  create zip...done
119
- zip file at #{@zip}
120
+ zip file at \"#{@zip}\"
120
121
  EOS
121
122
  end
122
123
 
123
124
  def get_relative base, target
124
- if base == target
125
- return '.'
126
- end
127
- if base[base.size - 1] != ?/
128
- base += '/'
129
- end
130
- target.sub(Regexp.escape(base), '')
125
+ Pathname.new(target.to_s).relative_path_from(Pathname.new(base.to_s)).to_s
131
126
  end
132
127
 
128
+
133
129
  def sign_zip
134
130
  puts "sign zip" if @verbose
135
131
  plain = nil
@@ -153,7 +149,7 @@ zip file at #{@zip}
153
149
  file << zip.read
154
150
  end
155
151
  end
156
- puts "done" if @verbose
152
+ puts "done at \"#{@crx}\"" if @verbose
157
153
  end
158
154
 
159
155
  def key_data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Constellation-crxmake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Constellation
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-11 00:00:00 -07:00
12
+ date: 2009-09-21 00:00:00 -07:00
13
13
  default_executable: crxmake
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -38,6 +38,7 @@ files:
38
38
  - lib/crxmake.rb
39
39
  has_rdoc: false
40
40
  homepage: http://github.com/Constellation/crxmake/tree/master
41
+ licenses:
41
42
  post_install_message:
42
43
  rdoc_options:
43
44
  - --main
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  requirements: []
64
65
 
65
66
  rubyforge_project: crxmake
66
- rubygems_version: 1.2.0
67
+ rubygems_version: 1.3.5
67
68
  signing_key:
68
69
  specification_version: 3
69
70
  summary: make chromium extension