cssdryer2 0.1

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.
@@ -0,0 +1,35 @@
1
+ spec_root_dir = File.expand_path(File.dirname(__FILE__) + '/..')
2
+ require File.expand_path(spec_root_dir + '/spec_helper')
3
+
4
+ describe CssDryer2::FilesHandler do
5
+
6
+ it "sets settings for files paths" do
7
+ file_handler = CssDryer2::FilesHandler.new(
8
+ :source_path => '/home/user/public_html/css/ncss',
9
+ :compile_path => '/home/user/public_html/css'
10
+ )
11
+ file_handler.source_path.should == '/home/user/public_html/css/ncss'
12
+ file_handler.compile_path.should == '/home/user/public_html/css'
13
+ file_handler.tmp_path.should == Dir.tmpdir + '/css_dryer_2_gem/tmp'
14
+ end
15
+
16
+ it "compiles files from the 'source' dir" do
17
+
18
+ FileUtils.mkdir_p(Dir.tmpdir + '/css_dryer_2_gem/css/ncss') unless File.exist?(Dir.tmpdir + '/css_dryer_2_gem/css/ncss')
19
+ FileUtils.mkdir(Dir.tmpdir + '/css_dryer_2_gem/tmp') unless File.exist?(Dir.tmpdir + '/css_dryer_2_gem/tmp')
20
+
21
+ file_handler = CssDryer2::FilesHandler.new(
22
+ :source_path => spec_root_dir,
23
+ :compile_path => Dir.tmpdir + '/css_dryer_2_gem/css'
24
+ )
25
+
26
+ file_handler.run(:force_compile => true)
27
+ Dir.new(Dir.tmpdir + '/css_dryer_2_gem/css').entries.should include('example.css')
28
+ end
29
+
30
+ after(:each) do
31
+ # cleaning up
32
+ FileUtils.rm_rf(Dir.tmpdir + '/css_dryer_2_gem')
33
+ end
34
+
35
+ end
@@ -0,0 +1,35 @@
1
+ spec_root_dir = File.expand_path(File.dirname(__FILE__) + '/..')
2
+ require File.expand_path(spec_root_dir + '/spec_helper')
3
+
4
+ describe CssDryer2::NcssHandler do
5
+
6
+ it "parses nccs and generates conventional css" do
7
+ ncss = <<END
8
+ body {
9
+ color: blue;
10
+ p {
11
+ color: red;
12
+ }
13
+ }
14
+ <% ie7 do %>
15
+ h2 {
16
+ margin-top: 1em;
17
+ }
18
+ <% end %>
19
+ END
20
+
21
+ compiled_ncss = <<END
22
+ body {
23
+ color: blue;
24
+ }
25
+ body p {
26
+ color: red;
27
+ }
28
+ * + html h2 {
29
+ margin-top: 1em;
30
+ }
31
+ END
32
+ CssDryer2::NcssHandler.new.compile(ncss).should == compiled_ncss
33
+ end
34
+
35
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,9 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ gem 'rspec'
6
+ require 'spec'
7
+ end
8
+
9
+ require File.dirname(__FILE__) + '/../lib/css_dryer_2'
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cssdryer2
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.1"
5
+ platform: ruby
6
+ authors:
7
+ - Roman Snitko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-04-17 00:00:00 +04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hoe
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.12.2
24
+ version:
25
+ description: "This gem is based on Rails plugin 'css_dryer': http://github.com/airblade/css_dryer. Unlike 'css_dryer', this one doesn't create any controllers and views. Instead, it acts more like SASS, but uses css_dryer parser (which allows you to use completely conventional css-syntax and write one-line css rules). * Read 'install' section to find out how to use it with Rails or any other Ruby appplication. * Read USAGE.markdown file to learn about css_dryer parser (copypasted from css_dryer README)."
26
+ email:
27
+ - roman@snitko.ru
28
+ executables: []
29
+
30
+ extensions: []
31
+
32
+ extra_rdoc_files:
33
+ - History.txt
34
+ - Manifest.txt
35
+ - README.txt
36
+ files:
37
+ - History.txt
38
+ - Manifest.txt
39
+ - README.txt
40
+ - Rakefile
41
+ - USAGE.markdown
42
+ - generators/css_dryer/css_dryer_generator.rb
43
+ - generators/css_dryer/templates/css_dryer_2.rake
44
+ - lib/css_dryer_2.rb
45
+ - lib/css_dryer_2/files_handler.rb
46
+ - lib/css_dryer_2/ncss_handler.rb
47
+ - lib/css_dryer_2/processor.rb
48
+ - lib/css_dryer_2/stylesheets_helper.rb
49
+ - spec/example.ncss
50
+ - spec/lib/css_dryer_test.rb
51
+ - spec/lib/files_handler_spec.rb
52
+ - spec/lib/ncss_handler_spec.rb
53
+ - spec/spec.opts
54
+ - spec/spec_helper.rb
55
+ has_rdoc: true
56
+ homepage: "This gem is based on Rails plugin 'css_dryer': http://github.com/airblade/css_dryer."
57
+ post_install_message:
58
+ rdoc_options:
59
+ - --main
60
+ - README.txt
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ requirements: []
76
+
77
+ rubyforge_project: cssdryer2
78
+ rubygems_version: 1.3.1
79
+ signing_key:
80
+ specification_version: 2
81
+ summary: "This gem is based on Rails plugin 'css_dryer': http://github.com/airblade/css_dryer"
82
+ test_files: []
83
+