btakita-jelly 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :build:
3
- :patch: 0
3
+ :patch: 1
4
4
  :major: 0
5
5
  :minor: 6
@@ -1,9 +1,10 @@
1
1
  module JellyHelper
2
2
 
3
3
  def application_jelly_files(jelly_files_path_from_javascripts = '', rails_root = RAILS_ROOT)
4
+ rails_root = File.expand_path(rails_root)
4
5
  (
5
- Dir["#{rails_root}/public/javascripts/#{jelly_files_path_from_javascripts}/components/**/*.js"] +
6
- Dir["#{rails_root}/public/javascripts/#{jelly_files_path_from_javascripts}/pages/**/*.js"]
6
+ Dir[File.expand_path("#{rails_root}/public/javascripts/#{jelly_files_path_from_javascripts}/components/**/*.js")] +
7
+ Dir[File.expand_path("#{rails_root}/public/javascripts/#{jelly_files_path_from_javascripts}/pages/**/*.js")]
7
8
  ).map do |path|
8
9
  path.gsub("#{rails_root}/public/javascripts/", "").gsub(/\.js$/, "")
9
10
  end
@@ -14,11 +14,22 @@ describe JellyHelper do
14
14
  end
15
15
 
16
16
  describe "#application_jelly_files" do
17
- it "returns the javascript files in /javascipts/pages and /javascipts/components" do
18
- my_rails_root = File.join(File.dirname(__FILE__), '/../fixtures')
19
- files = helper.application_jelly_files("foo", my_rails_root)
20
- files.should_not be_empty
21
- files.should =~ ['foo/components/paw', 'foo/components/teeth', 'foo/pages/lions', 'foo/pages/tigers', 'foo/pages/bears']
17
+ context "when passing in a jelly path" do
18
+ it "returns the javascript files in /javascipts/:jelly_path/pages and /javascipts/:jelly_path/components" do
19
+ my_rails_root = File.join(File.dirname(__FILE__), '/../fixtures')
20
+ files = helper.application_jelly_files("foo", my_rails_root)
21
+ files.should_not be_empty
22
+ files.should =~ ['foo/components/paw', 'foo/components/teeth', 'foo/pages/lions', 'foo/pages/tigers', 'foo/pages/bears']
23
+ end
24
+ end
25
+
26
+ context "when not passing in a jelly path" do
27
+ it "returns the javascript files in /javascipts/pages and /javascipts/components" do
28
+ my_rails_root = File.join(File.dirname(__FILE__), '/../fixtures')
29
+ files = helper.application_jelly_files("", my_rails_root)
30
+ files.should_not be_empty
31
+ files.should =~ ['components/component1', 'pages/page1']
32
+ end
22
33
  end
23
34
  end
24
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: btakita-jelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal Labs, Inc