jax 0.0.0.6 → 0.0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ * 0.0.0.7 *
2
+
3
+ * Fixed a bug which could cause applications to fail in production (after running
4
+ `rake jax:package`). It was due to the packager adding helper files in the wrong
5
+ order.
6
+
7
+
8
+
1
9
  * 0.0.0.6 *
2
10
 
3
11
  * Introduced Jax.uptime, a running total of number of seconds since the Jax subsystem
@@ -1,5 +1,5 @@
1
1
 
2
- var Jax = { PRODUCTION: 1, VERSION: "0.0.0.6" };
2
+ var Jax = { PRODUCTION: 1, VERSION: "0.0.0.7" };
3
3
 
4
4
  /* Called by Jax applications as of version 0.0.0.5 to alert the user to incomplete upgrades */
5
5
  Jax.doVersionCheck = function(targetVersion) {
@@ -5,6 +5,7 @@ class Jax::Packager::SprocketsTemplate < Sprockets::SourceFile
5
5
  end
6
6
 
7
7
  def template
8
+ added_files.clear
8
9
  @template ||= begin
9
10
  template = [
10
11
  'Jax.environment = Jax.PRODUCTION;',
@@ -12,17 +13,34 @@ class Jax::Packager::SprocketsTemplate < Sprockets::SourceFile
12
13
  '//= provide "public/"',
13
14
  ''
14
15
  ]
15
- Dir[Jax.root.join("app/**/*.js")].each do |jsfi|
16
- if File.file?(jsfi)
17
- relative_path = jsfi.sub(/^#{Regexp::escape Jax.root.to_s}[\/\\]?/, '')
18
- template << "//= require \"#{relative_path}\""
19
- end
20
- end
16
+ # Need to verify that helpers come first
17
+ Dir[Jax.root.join("app/helpers/**/*.js")].each { |jsfi| try_to_add_file(template, jsfi) }
18
+ Dir[Jax.root.join("app/**/*.js")].each { |jsfi| try_to_add_file(template, jsfi) }
21
19
 
22
20
  template
23
21
  end
24
22
  end
25
23
 
24
+ def try_to_add_file(template, jsfi)
25
+ if File.file?(jsfi) && !already_added?(jsfi)
26
+ add_file(template, jsfi)
27
+ end
28
+ end
29
+
30
+ def add_file(template, jsfi)
31
+ relative_path = jsfi.sub(/^#{Regexp::escape Jax.root.to_s}[\/\\]?/, '')
32
+ template << "//= require \"#{relative_path}\""
33
+ added_files << jsfi
34
+ end
35
+
36
+ def already_added?(jsfi)
37
+ added_files.include?(jsfi)
38
+ end
39
+
40
+ def added_files
41
+ @added_files ||= []
42
+ end
43
+
26
44
  def source_lines
27
45
  # basically the same as super but with a string instead of a file
28
46
  # TODO would templating be a worthy addition to Sprockets itself?
data/lib/jax/version.rb CHANGED
@@ -3,7 +3,7 @@ module Jax
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
5
  TINY = 0
6
- PATCH = 6
6
+ PATCH = 7
7
7
 
8
8
  STRING = PATCH == 0 ? "#{MAJOR}.#{MINOR}.#{TINY}" : "#{MAJOR}.#{MINOR}.#{TINY}.#{PATCH}"
9
9
  end
data/src/constants.yml CHANGED
@@ -1 +1 @@
1
- JAX_VERSION: 0.0.0.6
1
+ JAX_VERSION: 0.0.0.7
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jax
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.0.6
5
+ version: 0.0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Colin MacKenzie IV
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-28 00:00:00 -04:00
13
+ date: 2011-05-29 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -689,7 +689,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
689
689
  requirements:
690
690
  - - ">="
691
691
  - !ruby/object:Gem::Version
692
- hash: 3001490309694748403
692
+ hash: -2961147787499847116
693
693
  segments:
694
694
  - 0
695
695
  version: "0"
@@ -698,7 +698,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
698
698
  requirements:
699
699
  - - ">="
700
700
  - !ruby/object:Gem::Version
701
- hash: 3001490309694748403
701
+ hash: -2961147787499847116
702
702
  segments:
703
703
  - 0
704
704
  version: "0"