fusion 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/lib/basic.rb +16 -6
  2. data/lib/fusion.rb +1 -0
  3. data/lib/pretty.rb +17 -0
  4. metadata +63 -38
@@ -10,16 +10,26 @@ module Fusion
10
10
 
11
11
  class Basic
12
12
 
13
- def initialize
14
- @bundle_options = Fusion.instance_variable_get('@options')
15
- @log = @bundle_options[:logger] || Logger.new(STDOUT)
13
+ def initialize(bundle_config=nil, project_path=nil)
14
+
15
+ if bundle_config && project_path
16
16
 
17
- if @bundle_options[:bundle_configs]
18
- @bundle_configs = @bundle_options[:bundle_configs]
17
+ @bundle_configs = [bundle_config]
18
+ @bundle_options = { :project_path => project_path }
19
19
  else
20
- @bundle_configs = YAML::load(File.open(@bundle_options[:bundle_file_path]))
20
+
21
+ @bundle_options = Fusion.instance_variable_get('@options')
22
+
23
+ if @bundle_options[:bundle_configs]
24
+ @bundle_configs = @bundle_options[:bundle_configs]
25
+ else
26
+ @bundle_configs = YAML::load(File.open(@bundle_options[:bundle_file_path]))
27
+ end
28
+
21
29
  end
22
30
 
31
+ @log = @bundle_options[:logger] || Logger.new(STDOUT)
32
+
23
33
  end
24
34
 
25
35
  def run
@@ -1,6 +1,7 @@
1
1
  require 'basic'
2
2
  require 'quick'
3
3
  require 'optimized'
4
+ require 'pretty'
4
5
 
5
6
  module Fusion
6
7
 
@@ -0,0 +1,17 @@
1
+ module Fusion
2
+ class Pretty < Fusion::Optimized
3
+
4
+ private
5
+
6
+ def get_options(config)
7
+ options = super(config)
8
+
9
+ compilation_level_index = options.find_index {|opt| opt =~ /compilation_level/}
10
+ options[compilation_level_index] = ["--compilation_level WHITESPACE_ONLY"]
11
+ options << "--formatting PRETTY_PRINT"
12
+
13
+ options
14
+ end
15
+
16
+ end
17
+ end
metadata CHANGED
@@ -1,76 +1,101 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fusion
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.8
3
+ version: !ruby/object:Gem::Version
4
+ hash: 13
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 9
10
+ version: 0.0.9
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Sean Jezewski
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-10-24 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-12-02 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: open4
16
- requirement: &2152900880 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
22
32
  type: :runtime
23
- prerelease: false
24
- version_requirements: *2152900880
25
- - !ruby/object:Gem::Dependency
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
26
35
  name: mechanize
27
- requirement: &2152900440 !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
28
38
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
33
46
  type: :runtime
34
- prerelease: false
35
- version_requirements: *2152900440
36
- description: Fusion bundles and re-bundles your javascript in two modes - quick (dumb
37
- concatenation) and optimized (google closure compiler's SIMPLE_OPTIMIZATIONS level
38
- email:
47
+ version_requirements: *id002
48
+ description: Fusion bundles and re-bundles your javascript in two modes - quick (dumb concatenation) and optimized (google closure compiler's SIMPLE_OPTIMIZATIONS level
49
+ email:
39
50
  - sean@moovweb.com
40
51
  executables: []
52
+
41
53
  extensions: []
54
+
42
55
  extra_rdoc_files: []
43
- files:
56
+
57
+ files:
44
58
  - README.md
45
59
  - lib/basic.rb
46
60
  - lib/fusion.rb
47
61
  - lib/optimized.rb
62
+ - lib/pretty.rb
48
63
  - lib/quick.rb
49
64
  - compiler/compiler.jar
50
65
  - compiler/COPYING
51
66
  - compiler/README
52
67
  homepage: http://github.com/moovweb/fusion
53
68
  licenses: []
69
+
54
70
  post_install_message:
55
71
  rdoc_options: []
56
- require_paths:
72
+
73
+ require_paths:
57
74
  - lib
58
- required_ruby_version: !ruby/object:Gem::Requirement
75
+ required_ruby_version: !ruby/object:Gem::Requirement
59
76
  none: false
60
- requirements:
61
- - - ! '>='
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ hash: 3
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
85
  none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ hash: 3
90
+ segments:
91
+ - 0
92
+ version: "0"
70
93
  requirements: []
94
+
71
95
  rubyforge_project:
72
- rubygems_version: 1.8.6
96
+ rubygems_version: 1.8.11
73
97
  signing_key:
74
98
  specification_version: 3
75
99
  summary: Simple javascript bundler plugin.
76
100
  test_files: []
101
+