crxmake 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.rdoc +3 -1
  2. data/Rakefile +12 -13
  3. data/lib/crxmake.rb +6 -6
  4. data/test/crxmake_test.rb +5 -3
  5. metadata +37 -50
data/README.rdoc CHANGED
@@ -6,6 +6,8 @@
6
6
 
7
7
  make chromium extensions
8
8
 
9
+ ** Using 'zip' gem instead of 'zipruby' to support RubyInstaller for Windows.
10
+
9
11
  == SYNOPSIS:
10
12
  ruby code
11
13
  require 'crxmake'
@@ -62,7 +64,7 @@ command line
62
64
  == REQUIREMENTS:
63
65
 
64
66
  * openssl
65
- * zipruby
67
+ * zip
66
68
 
67
69
  == INSTALL:
68
70
 
data/Rakefile CHANGED
@@ -3,17 +3,16 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'rake/clean'
5
5
  require 'rake/testtask'
6
- require 'rake/packagetask'
7
- require 'rake/gempackagetask'
8
- require 'rake/rdoctask'
6
+ require 'rubygems/package_task'
9
7
  require 'rake/contrib/sshpublisher'
10
- require 'lib/crxmake'
8
+ require './lib/crxmake'
11
9
 
12
10
  $version = CrxMake::VERSION
13
11
  $readme = 'README.rdoc'
14
12
  $rdoc_opts = %W(--main #{$readme} --charset utf-8 --line-numbers --inline-source)
15
13
  $name = 'crxmake'
16
14
  $summary = 'make chromium extension'
15
+ $description = 'command line tool for making chromium extension'
17
16
  $author = 'Constellation'
18
17
  $email = 'utatane.tea@gmail.com'
19
18
  $page = 'http://github.com/Constellation/crxmake/tree/master'
@@ -38,7 +37,7 @@ spec = Gem::Specification.new do |s|
38
37
  s.extra_rdoc_files = [$readme]
39
38
  s.rdoc_options += $rdoc_opts
40
39
  s.summary = $summary
41
- s.description = $summary
40
+ s.description = $description
42
41
  s.author = $author
43
42
  s.email = $email
44
43
  s.homepage = $page
@@ -48,7 +47,7 @@ spec = Gem::Specification.new do |s|
48
47
  s.require_path = 'lib'
49
48
  s.test_files = Dir["test/*_test.rb"]
50
49
  {
51
- "zipruby" => ">=0.3.2",
50
+ "zip" => "~> 2.0.2",
52
51
  # "openssl" => ">=1.0.0"
53
52
  }.each do |dep, ver|
54
53
  s.add_dependency(dep, ver)
@@ -56,17 +55,17 @@ spec = Gem::Specification.new do |s|
56
55
  s.files = %w(README.rdoc Rakefile) + Dir["{bin,test,lib}/**/*"]
57
56
  end
58
57
 
59
- Rake::GemPackageTask.new(spec) do |p|
58
+ Gem::PackageTask.new(spec) do |p|
60
59
  p.need_tar = true
61
60
  p.gem_spec = spec
62
61
  end
63
62
 
64
- Rake::RDocTask.new do |rdoc|
65
- rdoc.rdoc_dir = 'doc'
66
- rdoc.options += $rdoc_opts
67
- # rdoc.template = 'resh'
68
- rdoc.rdoc_files.include("README.rdoc", "lib/**/*.rb", "ext/**/*.c")
69
- end
63
+ #RDoc::Task.new do |rdoc|
64
+ # rdoc.rdoc_dir = 'doc'
65
+ # rdoc.options += $rdoc_opts
66
+ ## rdoc.template = 'resh'
67
+ # rdoc.rdoc_files.include("README.rdoc", "lib/**/*.rb", "ext/**/*.c")
68
+ #end
70
69
 
71
70
  desc "gem spec"
72
71
  task :gemspec do
data/lib/crxmake.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/ruby
2
2
  # vim: fileencoding=utf-8
3
3
  require 'rubygems'
4
- require 'zipruby'
4
+ require 'zip'
5
5
  require 'openssl'
6
6
  require 'digest/sha1'
7
7
  require 'fileutils'
@@ -9,7 +9,7 @@ require 'find'
9
9
  require 'pathname'
10
10
 
11
11
  class CrxMake < Object
12
- VERSION = '2.0.3'
12
+ VERSION = '2.0.4'
13
13
  # thx masover
14
14
  MAGIC = 'Cr24'
15
15
 
@@ -46,7 +46,7 @@ class CrxMake < Object
46
46
  end
47
47
  create_zip do |zip|
48
48
  puts "include pem key: \"#{@pkey}\"" if @verbose
49
- zip.add_file('key.pem', @pkey)
49
+ zip.add('key.pem', @pkey)
50
50
  end
51
51
  end
52
52
 
@@ -150,7 +150,7 @@ ext dir: \"#{@exdir}\"
150
150
 
151
151
  def create_zip
152
152
  puts "create zip" if @verbose
153
- Zip::Archive.open(@zip, Zip::CREATE | Zip::TRUNC) do |zip|
153
+ Zip::ZipFile.open(@zip, Zip::ZipFile::CREATE) do |zip|
154
154
  Find.find(@exdir) do |path|
155
155
  unless path == @exdir
156
156
  if File.directory?(path)
@@ -159,14 +159,14 @@ ext dir: \"#{@exdir}\"
159
159
  Find.prune
160
160
  else
161
161
  puts "include dir: \"#{path}\"" if @verbose
162
- zip.add_dir(get_relative(@exdir, path))
162
+ zip.add(get_relative(@exdir, path))
163
163
  end
164
164
  else
165
165
  if @ignorefile && File.basename(path) =~ @ignorefile
166
166
  puts "ignore file: \"#{path}\"" if @verbose
167
167
  else
168
168
  puts "include file: \"#{path}\"" if @verbose
169
- zip.add_file(get_relative(@exdir, path), path)
169
+ zip.add(get_relative(@exdir, path), path)
170
170
  end
171
171
  end
172
172
  end
data/test/crxmake_test.rb CHANGED
@@ -6,7 +6,7 @@ require 'open-uri'
6
6
 
7
7
  class CrxMakeTest < Test::Unit::TestCase
8
8
  def setup
9
- @dir = File.expand_path(@method_name)
9
+ @dir = File.expand_path(__name__)
10
10
  FileUtils.mkdir @dir
11
11
  puts @dir
12
12
  # chromefullfeed compile
@@ -16,6 +16,7 @@ class CrxMakeTest < Test::Unit::TestCase
16
16
  end
17
17
  end
18
18
  system("tar -xf #{File.join(@dir, "package.tar")} -C #{@dir}")
19
+ @command = File.expand_path(File.dirname(__FILE__) + '/../bin/crxmake')
19
20
  end
20
21
  def teardown
21
22
  FileUtils.rm_rf @dir
@@ -45,12 +46,13 @@ class CrxMakeTest < Test::Unit::TestCase
45
46
  assert(File.exist?(File.join(@dir, 'test_zip.pem')))
46
47
  end
47
48
  def test_create_crx_command
48
- system("bin/crxmake --pack-extension='#{File.join(@dir, 'src')}' --extension-output='#{File.join(@dir, 'test_crx.crx')}' --key-output='#{File.join(@dir, 'test_crx.pem')}' --verbose")
49
+ puts `pwd`
50
+ system("ruby #{@command} --pack-extension='#{File.join(@dir, 'src')}' --extension-output='#{File.join(@dir, 'test_crx.crx')}' --key-output='#{File.join(@dir, 'test_crx.pem')}' --verbose")
49
51
  assert(File.exist?(File.join(@dir, 'test_crx.crx')))
50
52
  assert(File.exist?(File.join(@dir, 'test_crx.pem')))
51
53
  end
52
54
  def test_create_zip_command
53
- system("bin/crxmake --pack-extension='#{File.join(@dir, 'src')}' --zip-output='#{File.join(@dir, 'test_zip.zip')}' --key-output='#{File.join(@dir, 'test_zip.pem')}' --verbose")
55
+ system("ruby #{@command} --pack-extension='#{File.join(@dir, 'src')}' --zip-output='#{File.join(@dir, 'test_zip.zip')}' --key-output='#{File.join(@dir, 'test_zip.pem')}' --verbose")
54
56
  assert(File.exist?(File.join(@dir, 'test_zip.zip')))
55
57
  assert(File.exist?(File.join(@dir, 'test_zip.pem')))
56
58
  end
metadata CHANGED
@@ -1,45 +1,36 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: crxmake
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 2
7
- - 0
8
- - 3
9
- version: 2.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.4
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Constellation
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-04-28 00:00:00 +09:00
12
+ date: 2011-07-20 00:00:00.000000000 +09:00
18
13
  default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: zipruby
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- - 3
30
- - 2
31
- version: 0.3.2
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: zip
17
+ requirement: &77153770 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.2
32
23
  type: :runtime
33
- version_requirements: *id001
34
- description: make chromium extension
24
+ prerelease: false
25
+ version_requirements: *77153770
26
+ description: command line tool for making chromium extension
35
27
  email: utatane.tea@gmail.com
36
- executables:
28
+ executables:
37
29
  - crxmake
38
30
  extensions: []
39
-
40
- extra_rdoc_files:
31
+ extra_rdoc_files:
41
32
  - README.rdoc
42
- files:
33
+ files:
43
34
  - README.rdoc
44
35
  - Rakefile
45
36
  - bin/crxmake
@@ -48,37 +39,33 @@ files:
48
39
  has_rdoc: true
49
40
  homepage: http://github.com/Constellation/crxmake/tree/master
50
41
  licenses: []
51
-
52
42
  post_install_message:
53
- rdoc_options:
43
+ rdoc_options:
54
44
  - --main
55
45
  - README.rdoc
56
46
  - --charset
57
47
  - utf-8
58
48
  - --line-numbers
59
49
  - --inline-source
60
- require_paths:
50
+ require_paths:
61
51
  - lib
62
- required_ruby_version: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- segments:
67
- - 0
68
- version: "0"
69
- required_rubygems_version: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- segments:
74
- - 0
75
- version: "0"
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
76
64
  requirements: []
77
-
78
65
  rubyforge_project: crxmake
79
- rubygems_version: 1.3.6
66
+ rubygems_version: 1.6.2
80
67
  signing_key:
81
68
  specification_version: 3
82
69
  summary: make chromium extension
83
- test_files:
70
+ test_files:
84
71
  - test/crxmake_test.rb