tool-shed 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,11 +1,10 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rake"
4
- gem "i18n"
3
+ gem "rake", ">= 0.9.2"
5
4
 
6
5
  group :development do
7
6
  gem "shoulda"
8
7
  gem "mocha"
9
- gem "metric_fu"
10
- gem "ci_reporter"
8
+ gem "metric_fu", "~> 2.1.1"
9
+ gem "ci_reporter", "~> 1.6.5"
11
10
  end
data/Gemfile.lock CHANGED
@@ -2,81 +2,78 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  Saikuro (1.1.0)
5
- activesupport (3.0.3)
6
- arrayfields (4.7.4)
5
+ activesupport (3.1.1)
6
+ multi_json (~> 1.0)
7
7
  builder (3.0.0)
8
- chronic (0.2.3)
9
- hoe (>= 1.2.1)
10
- churn (0.0.12)
11
- chronic (~> 0.2.3)
8
+ chronic (0.3.0)
9
+ churn (0.0.13)
10
+ chronic (>= 0.2.3)
12
11
  hirb
13
12
  json_pure
14
13
  main
15
14
  ruby_parser (~> 2.0.4)
16
15
  sexp_processor (~> 3.0.3)
17
- ci_reporter (1.6.3)
16
+ ci_reporter (1.6.5)
18
17
  builder (>= 2.1.2)
19
18
  colored (1.2)
20
- fattr (2.2.0)
21
- flay (1.4.1)
19
+ erubis (2.7.0)
20
+ flay (1.4.3)
22
21
  ruby_parser (~> 2.0)
23
22
  sexp_processor (~> 3.0)
24
- flog (2.5.0)
23
+ flog (2.5.3)
25
24
  ruby_parser (~> 2.0)
26
25
  sexp_processor (~> 3.0)
27
- hirb (0.3.5)
28
- hoe (2.7.0)
29
- rake (>= 0.8.7)
30
- rubyforge (>= 2.0.4)
31
- i18n (0.4.2)
32
- json_pure (1.4.6)
33
- main (4.3.0)
34
- arrayfields (>= 4.7.4)
35
- fattr (>= 2.1.0)
36
- metric_fu (2.0.1)
26
+ hirb (0.5.0)
27
+ i18n (0.6.0)
28
+ json_pure (1.6.1)
29
+ main (4.7.1)
30
+ metaclass (0.0.1)
31
+ metric_fu (2.1.1)
37
32
  Saikuro (>= 1.1.0)
38
33
  activesupport (>= 2.0.0)
39
- chronic (~> 0.2.3)
34
+ chronic (~> 0.3.0)
40
35
  churn (>= 0.0.7)
41
36
  flay (>= 1.2.1)
42
- flog (>= 2.2.0)
43
- rails_best_practices (>= 0.3.16)
37
+ flog (>= 2.3.0)
38
+ rails_best_practices (>= 0.6.4)
44
39
  rcov (>= 0.8.3.3)
45
40
  reek (>= 1.2.6)
46
41
  roodi (>= 2.1.0)
47
- mocha (0.9.9)
48
- rake
49
- progressbar (0.9.0)
50
- rails_best_practices (0.5.0)
42
+ syntax
43
+ mocha (0.10.0)
44
+ metaclass (~> 0.0.1)
45
+ multi_json (1.0.3)
46
+ progressbar (0.9.1)
47
+ rails_best_practices (1.1.0)
51
48
  activesupport
52
- colored (~> 1.2)
53
- progressbar (~> 0.9.0)
54
- ruby_parser (~> 2.0.4)
55
- rake (0.8.7)
56
- rcov (0.9.9)
49
+ colored
50
+ erubis
51
+ i18n
52
+ progressbar
53
+ sexp_processor
54
+ rake (0.9.2)
55
+ rcov (0.9.11)
57
56
  reek (1.2.8)
58
57
  ruby2ruby (~> 1.2)
59
58
  ruby_parser (~> 2.0)
60
59
  sexp_processor (~> 3.0)
61
60
  roodi (2.1.0)
62
61
  ruby_parser
63
- ruby2ruby (1.2.5)
62
+ ruby2ruby (1.3.1)
64
63
  ruby_parser (~> 2.0)
65
64
  sexp_processor (~> 3.0)
66
- ruby_parser (2.0.5)
65
+ ruby_parser (2.0.6)
67
66
  sexp_processor (~> 3.0)
68
- rubyforge (2.0.4)
69
- json_pure (>= 1.1.7)
70
- sexp_processor (3.0.5)
67
+ sexp_processor (3.0.7)
71
68
  shoulda (2.11.3)
69
+ syntax (1.0.0)
72
70
 
73
71
  PLATFORMS
74
72
  ruby
75
73
 
76
74
  DEPENDENCIES
77
- ci_reporter
78
- i18n
79
- metric_fu
75
+ ci_reporter (~> 1.6.5)
76
+ metric_fu (~> 2.1.1)
80
77
  mocha
81
- rake
78
+ rake (>= 0.9.2)
82
79
  shoulda
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Tool Shed
2
2
 
3
- A collection of utility scripts to help working with ActionScript and Flex
4
- projects. They are under development, so **don't** expect too much reliability.
3
+ A collection of utility scripts and rake tasks to help working with ActionScript
4
+ and Flex projects. They are under development, so **don't** expect too much reliability.
5
5
 
6
6
  All tools have help available on the command line, to view use: `as-tool-name -h`
7
7
 
@@ -61,6 +61,29 @@ method implementations, and `-t mock4as` will generate a Mock4AS class.
61
61
  as-concrete -i IShed.as -t mock4as
62
62
  as-concrete -i IShed.as -t class
63
63
  as-concrete -i IShed.as -t imp
64
+
65
+ ## Rake tasks
66
+
67
+ Insert Copyright headers into all of your ActionScript source files
68
+
69
+ headers do |t|
70
+ t.copyright = 'Copyright MMXI Big Corporation. All Rights Reserved.'
71
+ end
72
+
73
+ To generate a manifest.xml file for use when declaring namespaces to the flex compilers
74
+
75
+ manifest do |t|
76
+ t.output = 'src/Desktop-manifest.xml'
77
+ t.filter = 'bbc.ipd.view.components'
78
+ end
79
+
80
+ To make a version file from a template which contains the keys @major@, @minor@, @patch@, @revision@
81
+
82
+ version do |t|
83
+ t.template = 'etc/templates/Version.as'
84
+ t.major, t.minor, t.patch = 5, 0, 0
85
+ t.output = 'src/org/app/Version.as'
86
+ end
64
87
 
65
88
  ## Install
66
89
 
@@ -5,7 +5,7 @@ Bundler.require
5
5
  require 'metric_fu'
6
6
  require 'rake/clean'
7
7
  require 'rake/testtask'
8
- require 'rake/rdoctask'
8
+ require 'rdoc/task'
9
9
 
10
10
  ENV['CI_REPORTS'] = 'tmp/reports' #Hide these here for now...
11
11
  require 'ci/reporter/rake/test_unit'
@@ -48,24 +48,31 @@ task :hudson => ['ci:setup:testunit', :test, 'metrics:all']
48
48
  #
49
49
  #############################################################################
50
50
 
51
+ desc "Build and release the gem"
51
52
  task :release do
52
53
  puts ""
53
54
  print "Are you sure you want to relase tool-shed #{ToolShed::VERSION::STRING}? [y/N] "
54
55
  exit unless STDIN.gets.index(/y/i) == 0
55
-
56
+
56
57
  unless `git branch` =~ /^\* master$/
57
58
  puts "You must be on the master branch to release!"
58
59
  exit!
59
60
  end
60
-
61
+
61
62
  # Build gem and upload
62
63
  sh "gem build tool-shed.gemspec"
63
64
  sh "gem push tool-shed-#{ToolShed::VERSION::STRING}.gem"
64
65
  sh "rm tool-shed-#{ToolShed::VERSION::STRING}.gem"
65
-
66
+
66
67
  # Commit
67
68
  sh "git commit --allow-empty -a -m 'v#{ToolShed::VERSION::STRING}'"
68
69
  sh "git tag v#{ToolShed::VERSION::STRING}"
69
70
  sh "git push origin master"
70
71
  sh "git push origin v#{ToolShed::VERSION::STRING}"
71
72
  end
73
+
74
+ desc "Build and install the gem"
75
+ task :install do
76
+ sh "gem build tool-shed.gemspec"
77
+ sh "gem install tool-shed-#{ToolShed::VERSION::STRING}.gem"
78
+ end
@@ -0,0 +1,58 @@
1
+ # encoding: utf-8
2
+
3
+ module FlexHeaders
4
+ class Task < Rake::TaskLib
5
+ attr_writer :paths
6
+
7
+ def copyright=(value)
8
+ make_header(value)
9
+ end
10
+
11
+ def initialize name = :headers
12
+ @name = name
13
+ @paths = 'src,test'
14
+ @header = make_header
15
+
16
+ yield self if block_given?
17
+
18
+ define
19
+ end
20
+
21
+ def define
22
+ desc "Updates all ActionScript source files to include copyright headers"
23
+ task @name do
24
+ Dir[ "{#{@paths}}/**/*.as" ].each do |uri|
25
+ src = IO.read( uri )
26
+ File.open( uri, 'w+' ) do |f|
27
+ f << src.sub( /.+?(?=package)/m, @header )
28
+ end
29
+ end
30
+ puts "Added copyright header to all .as files"
31
+ end
32
+ end
33
+
34
+ private
35
+
36
+ def make_header(rights=default_rights)
37
+ @header = as3_header.sub('[COPYRIGHT]', rights)
38
+ end
39
+
40
+ def default_rights
41
+ "Copyright #{Time.new().year} the original author or authors."
42
+ end
43
+
44
+ def as3_header
45
+ %{//AS3///////////////////////////////////////////////////////////////////////////
46
+ //
47
+ // [COPYRIGHT]
48
+ //
49
+ ////////////////////////////////////////////////////////////////////////////////
50
+
51
+ }
52
+ end
53
+ end
54
+ end
55
+
56
+ def headers *args, &block
57
+ FlexHeaders::Task.new *args, &block
58
+ end
@@ -0,0 +1,38 @@
1
+ # encoding: utf-8
2
+
3
+ module FlexManifest
4
+ class Task < Rake::TaskLib
5
+ attr_accessor :filter,
6
+ :src,
7
+ :output,
8
+ :silent
9
+
10
+ def initialize name = :manifest
11
+ @name = name
12
+ @output = 'manifest.xml'
13
+ @filter = ''
14
+ @silent = false
15
+
16
+ yield self if block_given?
17
+
18
+ define
19
+ end
20
+
21
+ def define
22
+ desc "Generate a manifest file "
23
+ task @name do
24
+ Manifest.new(to_hash)
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ def to_hash
31
+ { :filter => filter, :src => src, :output => output, :silent => silent }
32
+ end
33
+ end
34
+ end
35
+
36
+ def manifest *args, &block
37
+ FlexManifest::Task.new *args, &block
38
+ end
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+
3
+ module ActionScriptVersion
4
+ class Task < Rake::TaskLib
5
+ attr_accessor :major,
6
+ :minor,
7
+ :patch,
8
+ :template,
9
+ :output
10
+
11
+ def initialize name = :version
12
+ @name = name
13
+ @output = 'Version.as'
14
+
15
+ yield self if block_given?
16
+
17
+ define
18
+ end
19
+
20
+ def define
21
+ desc "Generate a ActionScript class containing application version details"
22
+ task @name do
23
+ revision = `git rev-parse HEAD`.chomp rescue 'no-git-rev'
24
+ t = File.read(@template)
25
+ t.sub!('@major@', major.to_s)
26
+ t.sub!('@minor@', minor.to_s)
27
+ t.sub!('@patch@', patch.to_s)
28
+ t.sub!('@revision@', revision)
29
+ File.open(@output, 'w') {|f| f.write(t) }
30
+
31
+ puts "Created #{output}, v#{major}.#{minor}.#{patch} [#{revision[0..10]}]"
32
+ end
33
+ end
34
+
35
+ private
36
+
37
+ def to_hash
38
+ {
39
+ :major => major, :minor => minor, :patch => patch, :template => template, :output => output
40
+ }
41
+ end
42
+ end
43
+ end
44
+
45
+ def version *args, &block
46
+ ActionScriptVersion::Task.new *args, &block
47
+ end
data/lib/shed/tasks.rb CHANGED
@@ -1,84 +1,14 @@
1
- require 'rake'
2
- require 'rake/tasklib'
1
+ # encoding: utf-8
3
2
 
4
- class HeadersTask < Rake::TaskLib
3
+ begin
4
+ Rake
5
5
 
6
- attr_writer :paths
6
+ require 'rake/tasklib'
7
7
 
8
- def copyright=(value)
9
- make_header(value)
10
- end
11
-
12
- def initialize name = :headers
13
- @name = name
14
- @paths = 'src,test'
15
- @header = make_header
16
-
17
- yield self if block_given?
18
-
19
- define
20
- end
21
-
22
- def define
23
- desc "Updates all ActionScript source files to include copyright headers"
24
- task @name do
25
- Dir[ "{#{@paths}}/**/*.as" ].each do |uri|
26
- src = IO.read( uri )
27
- File.open( uri, 'w+' ) do |f|
28
- f << src.sub( /.+?(?=package)/m, @header )
29
- end
30
- end
31
- end
32
- end
33
-
34
- private
35
-
36
- def make_header(rights=default_rights)
37
- @header = as3_header.sub('[COPYRIGHT]', rights)
38
- end
39
-
40
- def default_rights
41
- "Copyright #{Time.new().year} the original author or authors."
42
- end
43
-
44
- def as3_header
45
- %{//AS3///////////////////////////////////////////////////////////////////////////
46
- //
47
- // [COPYRIGHT]
48
- //
49
- ////////////////////////////////////////////////////////////////////////////////
50
-
51
- }
52
- end
53
- end
54
-
55
- class ManifestTask < Rake::TaskLib
56
- attr_accessor :filter,
57
- :src,
58
- :output,
59
- :silent
60
-
61
- def initialize name = :manifest
62
- @name = name
63
- @output = 'manifest.xml'
64
- @filter = ''
65
- @silent = true
66
-
67
- yield self if block_given?
68
-
69
- define
70
- end
71
-
72
- def define
73
- desc "Generate a manifest file "
74
- task @name do
75
- Manifest.new(to_hash)
76
- end
77
- end
78
-
79
- private
80
-
81
- def to_hash
82
- { :filter => filter, :src => src, :output => output, :silent => silent }
83
- end
8
+ require 'shed/rake/version'
9
+ require 'shed/rake/headers'
10
+ require 'shed/rake/manifest'
11
+ rescue
12
+ # Only require the rake tasks where rake is already present on the load path
13
+ # Otherwise keep quiet...
84
14
  end
data/lib/shed/version.rb CHANGED
@@ -5,7 +5,7 @@ module ToolShed #:nodoc:
5
5
  module VERSION #:nodoc:
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- TINY = 9
8
+ TINY = 10
9
9
 
10
10
  STRING = [MAJOR, MINOR, TINY].join('.')
11
11
  end
data/lib/tool_shed.rb CHANGED
@@ -18,6 +18,7 @@ require 'shed/opts/style_vacuum_opts'
18
18
  require 'shed/project_tools'
19
19
  require 'shed/search'
20
20
  require 'shed/stripper'
21
+ require 'shed/tasks'
21
22
  require 'shed/interface'
22
23
  require 'shed/asset_vacuum'
23
24
  require 'shed/class_vacuum'
@@ -25,7 +25,7 @@ class TestClassVacuum < Test::Unit::TestCase
25
25
 
26
26
  should "find empty packages" do
27
27
  assert @tool.empty_packages.length > 0
28
- assert_equal('org/helvector', @tool.empty_packages[0])
28
+ assert_equal('org', @tool.empty_packages[0])
29
29
  end
30
30
 
31
31
  should "have valid options" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tool-shed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,33 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-08 00:00:00.000000000Z
12
+ date: 2011-10-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70301908508060 !ruby/object:Gem::Requirement
16
+ requirement: &70318240049400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *70301908508060
25
- - !ruby/object:Gem::Dependency
26
- name: i18n
27
- requirement: &70301908506380 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
21
+ version: 0.9.2
33
22
  type: :runtime
34
23
  prerelease: false
35
- version_requirements: *70301908506380
24
+ version_requirements: *70318240049400
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: shoulda
38
- requirement: &70301908504360 !ruby/object:Gem::Requirement
27
+ requirement: &70318239945140 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
30
  - - ! '>='
@@ -43,10 +32,10 @@ dependencies:
43
32
  version: '0'
44
33
  type: :development
45
34
  prerelease: false
46
- version_requirements: *70301908504360
35
+ version_requirements: *70318239945140
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: mocha
49
- requirement: &70301908502820 !ruby/object:Gem::Requirement
38
+ requirement: &70318239944460 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
41
  - - ! '>='
@@ -54,30 +43,31 @@ dependencies:
54
43
  version: '0'
55
44
  type: :development
56
45
  prerelease: false
57
- version_requirements: *70301908502820
46
+ version_requirements: *70318239944460
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: metric_fu
60
- requirement: &70301908501860 !ruby/object:Gem::Requirement
49
+ requirement: &70318239943840 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
- - - ! '>='
52
+ - - ~>
64
53
  - !ruby/object:Gem::Version
65
- version: '0'
54
+ version: 2.1.1
66
55
  type: :development
67
56
  prerelease: false
68
- version_requirements: *70301908501860
57
+ version_requirements: *70318239943840
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: ci_reporter
71
- requirement: &70301908500840 !ruby/object:Gem::Requirement
60
+ requirement: &70318239943280 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
- - - ! '>='
63
+ - - ~>
75
64
  - !ruby/object:Gem::Version
76
- version: '0'
65
+ version: 1.6.5
77
66
  type: :development
78
67
  prerelease: false
79
- version_requirements: *70301908500840
80
- description: Utility scripts for working with ActionScript and Flex projects.
68
+ version_requirements: *70318239943280
69
+ description: Utility scripts and Rake tasks for working with ActionScript and Flex
70
+ projects.
81
71
  email: tool-shed@helvector.org
82
72
  executables:
83
73
  - as-docp
@@ -117,6 +107,9 @@ files:
117
107
  - lib/shed/opts/style_vacuum_opts.rb
118
108
  - lib/shed/opts/tool_opts.rb
119
109
  - lib/shed/project_tools.rb
110
+ - lib/shed/rake/headers.rb
111
+ - lib/shed/rake/manifest.rb
112
+ - lib/shed/rake/version.rb
120
113
  - lib/shed/search.rb
121
114
  - lib/shed/stripper.rb
122
115
  - lib/shed/style_vacuum.rb
@@ -125,7 +118,7 @@ files:
125
118
  - lib/shed/version.rb
126
119
  - lib/tool_shed.rb
127
120
  - LICENSE
128
- - rakefile.rb
121
+ - Rakefile
129
122
  - README.md
130
123
  - test/fixtures/interface/ISeedPacket.as
131
124
  - test/fixtures/interface/IShed.as
@@ -198,10 +191,21 @@ post_install_message: ! 'Welcome to the Tool-Shed
198
191
 
199
192
  ========================
200
193
 
201
- Get Tooled Up 0.0.9. Kick off.
194
+ Get Tooled Up 0.0.10. Kick off.
195
+
196
+
197
+ Thanks for installing, the tools are under development
198
+
199
+ so may be a little tempremental. When they ''just work''
200
+
201
+ it''s likely they''re running from a project root, which
202
+
203
+ contains src, test and lib dirs.
204
+
202
205
 
206
+ See the README for more details, each tool can be run
203
207
 
204
- Thanks for installing, the tools are under development. Don''t expect reliability.
208
+ with -h for a list of options.
205
209
 
206
210
 
207
211
  '
@@ -215,6 +219,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
219
  - - ! '>='
216
220
  - !ruby/object:Gem::Version
217
221
  version: '0'
222
+ segments:
223
+ - 0
224
+ hash: 1010168293613526505
218
225
  required_rubygems_version: !ruby/object:Gem::Requirement
219
226
  none: false
220
227
  requirements: