hotchpotch-chrome-extension-starter 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -5
- data/Rakefile +1 -1
- data/templates/Rakefile +39 -4
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
|
2
2
|
= chrome-extension-starter
|
3
3
|
|
4
|
+
Google Chrome extension templates and Rakefile generator.
|
4
5
|
|
5
6
|
== Description
|
6
7
|
|
7
8
|
== Installation
|
8
9
|
|
9
|
-
=== Archive Installation
|
10
|
-
|
11
|
-
rake install
|
12
|
-
|
13
10
|
=== Gem Installation
|
14
11
|
|
15
12
|
gem sources -a http://gems.github.com
|
@@ -23,7 +20,9 @@
|
|
23
20
|
|
24
21
|
chrome-extension-starter myextension
|
25
22
|
cd myextension
|
26
|
-
rake
|
23
|
+
rake # manifest.json validate
|
24
|
+
rake update_xml
|
25
|
+
rake package
|
27
26
|
|
28
27
|
== Copyright
|
29
28
|
|
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ DESCRIPTION = ""
|
|
17
17
|
RUBYFORGE_PROJECT = "chromeextensionstarter"
|
18
18
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
19
19
|
BIN_FILES = %w( chrome-extension-starter )
|
20
|
-
VERS = "0.0
|
20
|
+
VERS = "0.1.0"
|
21
21
|
|
22
22
|
REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
|
23
23
|
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
data/templates/Rakefile
CHANGED
@@ -2,7 +2,16 @@
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'json/pure'
|
4
4
|
require 'rake'
|
5
|
+
require 'rake/clean'
|
5
6
|
require 'pathname'
|
7
|
+
begin
|
8
|
+
require 'crxmake'
|
9
|
+
rescue LoadError
|
10
|
+
warn "require jsonschema"
|
11
|
+
warn "gem sources -a http://gems.github.com"
|
12
|
+
warn "gem install Constellation-crxmake"
|
13
|
+
exit 1
|
14
|
+
end
|
6
15
|
require 'crxmake'
|
7
16
|
require 'open-uri'
|
8
17
|
|
@@ -19,13 +28,22 @@ update_path = src_path.join('update.xml')
|
|
19
28
|
output_path = root_path.join('bin')
|
20
29
|
pem_file = ENV['PEM'] || root_path.join(project_name + '.pem')
|
21
30
|
|
22
|
-
task :release => [:update_xml, :package]
|
23
|
-
task :default => [:
|
31
|
+
task :release => [:clean, :update_xml, :package]
|
32
|
+
task :default => ['manifest:validate']
|
33
|
+
|
34
|
+
CLEAN.include ['**/.*.sw?', '.*.sw?']
|
24
35
|
|
25
36
|
namespace :manifest do
|
26
37
|
desc "json schema check"
|
27
|
-
task :
|
28
|
-
|
38
|
+
task :validate do
|
39
|
+
begin
|
40
|
+
require 'jsonschema'
|
41
|
+
rescue LoadError
|
42
|
+
warn "require jsonschema"
|
43
|
+
warn "gem sources -a http://gems.github.com"
|
44
|
+
warn "gem install Constellation-jsonschema"
|
45
|
+
exit 1
|
46
|
+
end
|
29
47
|
data = JSON.parse manifest_path.read
|
30
48
|
schema = JSON.parse open('http://gist.github.com/179669.txt').read # manifest.json schema by os0x
|
31
49
|
puts "JSON schema check."
|
@@ -39,6 +57,22 @@ namespace :manifest do
|
|
39
57
|
end
|
40
58
|
end
|
41
59
|
|
60
|
+
task :update_xml do
|
61
|
+
puts "update xml: #{update_path}"
|
62
|
+
manifest = JSON.parse manifest_path.read
|
63
|
+
raise 'require id & version' unless manifest['id'] && manifest['version']
|
64
|
+
template = <<-EOF
|
65
|
+
<gupdate xmlns="http://www.google.com/update2/response" protocol="2.0">
|
66
|
+
<app appid="#{manifest['id']}">
|
67
|
+
<updatecheck codebase="#{extension_url}" version="#{manifest['version']}" />
|
68
|
+
</app>
|
69
|
+
</gupdate>
|
70
|
+
EOF
|
71
|
+
update_path.open('w') do |f|
|
72
|
+
f.puts template
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
42
76
|
task :package do
|
43
77
|
output_path.mkpath unless output_path.directory?
|
44
78
|
crx = output_path.join("#{project_name}.crx").to_s
|
@@ -59,3 +93,4 @@ task :package do
|
|
59
93
|
puts "generated pkem(.pem): #{options[:pkey_output]}" if options[:pkey_output]
|
60
94
|
end
|
61
95
|
|
96
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotchpotch-chrome-extension-starter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hotchpotch
|
@@ -9,7 +9,7 @@ autorequire: ""
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-25 00:00:00 -07:00
|
13
13
|
default_executable: chrome-extension-starter
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|