yukiko-merb_dynamic_sass 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ AUTHOR = "Yukiko Kawamoto"
9
9
  EMAIL = "yu0420@gmail.com"
10
10
  HOMEPAGE = "http://github.com/yukiko"
11
11
  SUMMARY = "Merb Dynamic Sass is a Merb Slice that provides more handy way to use Sass engine."
12
- GEM_VERSION = "0.0.2"
12
+ GEM_VERSION = "0.0.3"
13
13
 
14
14
  spec = Gem::Specification.new do |s|
15
15
  s.rubyforge_project = 'merb'
@@ -22,10 +22,8 @@ class MerbDynamicSass::Stylesheets < MerbDynamicSass::Application
22
22
  end
23
23
 
24
24
 
25
- # TODO the rest is that prividing the way to generate file under the document root
26
- # by useing slice.page_cache_store.
27
- def index
28
- @template_path = params[:path]
25
+ def index(path)
26
+ @template_path = path
29
27
  if self.slice.action_cache_store.exists?(_cache_path)
30
28
 
31
29
  m_template = File.mtime _location_of_template
@@ -37,6 +35,7 @@ class MerbDynamicSass::Stylesheets < MerbDynamicSass::Application
37
35
 
38
36
  end
39
37
 
38
+ self.content_type = :css
40
39
  self.slice.action_cache_store.fetch _cache_path do
41
40
  sass = render(:format => :css)
42
41
  Sass::Engine.new(sass).to_css
@@ -106,5 +106,6 @@ if defined?(Merb::Plugins)
106
106
  # Add dependencies for other MerbDynamicSass classes below. Example:
107
107
  # dependency "merb_dynamic_sass/other"
108
108
  dependency "merb-cache"
109
+ dependency "merb-action-args"
109
110
 
110
111
  end
@@ -7,6 +7,12 @@ describe "GET /stylesheets/filepath.css" do
7
7
  mount_slice
8
8
  @store = MerbDynamicSass.action_cache_store
9
9
  @file = MerbDynamicSass.dir_for(:view) / :stylesheets / "basic.css.erb"
10
+
11
+ # This direcotry is necessary for this test.
12
+ template_dir = MerbDynamicSass.dir_for(:view) / :stylesheets
13
+ unless File.directory? template_dir
14
+ FileUtils.mkdir_p template_dir
15
+ end
10
16
 
11
17
  # Create a template file
12
18
  @store.send :write_file, @file, <<-CONTENT
@@ -26,6 +32,11 @@ h1
26
32
  response = request("/stylesheets/basic.css")
27
33
  response.status.should be_successful
28
34
  response.headers["Content-Type"].should == "text/css"
35
+
36
+ # doing twice to see the case when the cached file is exists.
37
+ response = request("/stylesheets/basic.css")
38
+ response.status.should be_successful
39
+ response.headers["Content-Type"].should == "text/css"
29
40
  end
30
41
 
31
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yukiko-merb_dynamic_sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukiko Kawamoto
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-21 00:00:00 -08:00
12
+ date: 2009-03-02 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -47,32 +47,32 @@ files:
47
47
  - README
48
48
  - Rakefile
49
49
  - TODO
50
- - lib/merb_dynamic_sass.rb
51
50
  - lib/merb_dynamic_sass
52
- - lib/merb_dynamic_sass/slicetasks.rb
53
51
  - lib/merb_dynamic_sass/merbtasks.rb
52
+ - lib/merb_dynamic_sass/slicetasks.rb
54
53
  - lib/merb_dynamic_sass/spectasks.rb
54
+ - lib/merb_dynamic_sass.rb
55
+ - spec/merb_dynamic_sass_spec.rb
55
56
  - spec/requests
56
57
  - spec/requests/stylesheets_spec.rb
57
58
  - spec/spec_helper.rb
58
- - spec/merb_dynamic_sass_spec.rb
59
- - app/helpers
60
- - app/helpers/application_helper.rb
61
59
  - app/controllers
62
- - app/controllers/stylesheets.rb
63
60
  - app/controllers/application.rb
61
+ - app/controllers/stylesheets.rb
62
+ - app/helpers
63
+ - app/helpers/application_helper.rb
64
64
  - app/views
65
65
  - app/views/layout
66
66
  - app/views/layout/merb_dynamic_sass.html.erb
67
67
  - app/views/stylesheets
68
- - public/stylesheets
69
- - public/stylesheets/master.css
70
68
  - public/javascripts
71
69
  - public/javascripts/master.js
70
+ - public/stylesheets
71
+ - public/stylesheets/master.css
72
72
  - stubs/app
73
73
  - stubs/app/controllers
74
- - stubs/app/controllers/main.rb
75
74
  - stubs/app/controllers/application.rb
75
+ - stubs/app/controllers/main.rb
76
76
  has_rdoc: true
77
77
  homepage: http://github.com/yukiko
78
78
  post_install_message: