epuber-stylus 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +10 -0
  3. data/LICENSE +22 -0
  4. data/README.md +154 -0
  5. data/lib/epuber-stylus.rb +174 -0
  6. data/lib/epuber-stylus/import_processor.rb +71 -0
  7. data/lib/epuber-stylus/railtie.rb +32 -0
  8. data/lib/epuber-stylus/runtime.rb +54 -0
  9. data/lib/epuber-stylus/runtime/compiler.js +40 -0
  10. data/lib/epuber-stylus/runtime/runner.js +20 -0
  11. data/lib/epuber-stylus/sprockets.rb +58 -0
  12. data/lib/epuber-stylus/tilt.rb +2 -0
  13. data/lib/epuber-stylus/tilt/rails.rb +51 -0
  14. data/lib/epuber-stylus/tilt/stylus.rb +52 -0
  15. data/lib/epuber-stylus/version.rb +3 -0
  16. data/lib/rails/generators/epuber-stylus/assets/assets_generator.rb +13 -0
  17. data/lib/rails/generators/epuber-stylus/assets/templates/stylesheet.css.styl +3 -0
  18. data/lib/rails/generators/epuber-stylus/scaffold/scaffold_generator.rb +11 -0
  19. data/spec/generators/assets_generator_spec.rb +11 -0
  20. data/spec/generators/controller_generator_spec.rb +12 -0
  21. data/spec/generators/scaffold_generator_spec.rb +17 -0
  22. data/spec/import_processor_spec.rb +67 -0
  23. data/spec/rails_spec.rb +46 -0
  24. data/spec/runtime_spec.rb +11 -0
  25. data/spec/spec_helper.rb +30 -0
  26. data/spec/sprockets_spec.rb +36 -0
  27. data/spec/stylus_spec.rb +118 -0
  28. data/spec/support/generators/test_case.rb +59 -0
  29. data/spec/support/generators/tmp/app/controllers/posts_controller.rb +58 -0
  30. data/spec/support/generators/tmp/app/helpers/posts_helper.rb +2 -0
  31. data/spec/support/generators/tmp/config/routes.rb +0 -0
  32. data/spec/support/helpers.rb +63 -0
  33. data/spec/support/matchers.rb +5 -0
  34. data/spec/tilt/rails_spec.rb +64 -0
  35. data/spec/tilt/stylus_spec.rb +24 -0
  36. metadata +137 -0
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+ require 'epuber-stylus/tilt/stylus'
3
+
4
+ describe Tilt::StylusTemplate do
5
+ it 'registers the template for .styl files' do
6
+ expect(Tilt['application.styl']).to eq(Stylus::Rails::StylusTemplate)
7
+ end
8
+
9
+ it 'has a content-type' do
10
+ expect(Tilt::StylusTemplate.default_mime_type).to eq('text/css')
11
+ end
12
+
13
+ it 'compiles the given source' do
14
+ input, output = fixture(:simple)
15
+ template = Tilt::StylusTemplate.new { |_| input }
16
+ expect(template.render).to eq(output)
17
+ end
18
+
19
+ it 'compiles with the compress option' do
20
+ input, output = fixture(:compressed)
21
+ template = Tilt::StylusTemplate.new(compress: true) { |_| input }
22
+ expect(template.render).to eq(output.rstrip)
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: epuber-stylus
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Lucas Mazza
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: execjs
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: stylus-source
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: coveralls
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.8.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.8.0
55
+ description: Bridge library to compile .styl stylesheets from ruby code.
56
+ email:
57
+ - luc4smazza@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - CHANGELOG.md
63
+ - LICENSE
64
+ - README.md
65
+ - lib/epuber-stylus.rb
66
+ - lib/epuber-stylus/import_processor.rb
67
+ - lib/epuber-stylus/railtie.rb
68
+ - lib/epuber-stylus/runtime.rb
69
+ - lib/epuber-stylus/runtime/compiler.js
70
+ - lib/epuber-stylus/runtime/runner.js
71
+ - lib/epuber-stylus/sprockets.rb
72
+ - lib/epuber-stylus/tilt.rb
73
+ - lib/epuber-stylus/tilt/rails.rb
74
+ - lib/epuber-stylus/tilt/stylus.rb
75
+ - lib/epuber-stylus/version.rb
76
+ - lib/rails/generators/epuber-stylus/assets/assets_generator.rb
77
+ - lib/rails/generators/epuber-stylus/assets/templates/stylesheet.css.styl
78
+ - lib/rails/generators/epuber-stylus/scaffold/scaffold_generator.rb
79
+ - spec/generators/assets_generator_spec.rb
80
+ - spec/generators/controller_generator_spec.rb
81
+ - spec/generators/scaffold_generator_spec.rb
82
+ - spec/import_processor_spec.rb
83
+ - spec/rails_spec.rb
84
+ - spec/runtime_spec.rb
85
+ - spec/spec_helper.rb
86
+ - spec/sprockets_spec.rb
87
+ - spec/stylus_spec.rb
88
+ - spec/support/generators/test_case.rb
89
+ - spec/support/generators/tmp/app/controllers/posts_controller.rb
90
+ - spec/support/generators/tmp/app/helpers/posts_helper.rb
91
+ - spec/support/generators/tmp/config/routes.rb
92
+ - spec/support/helpers.rb
93
+ - spec/support/matchers.rb
94
+ - spec/tilt/rails_spec.rb
95
+ - spec/tilt/stylus_spec.rb
96
+ homepage: https://github.com/lucasmazza/ruby-stylus
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubyforge_project:
116
+ rubygems_version: 2.5.1
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: Ruby Stylus Compiler
120
+ test_files:
121
+ - spec/generators/assets_generator_spec.rb
122
+ - spec/generators/controller_generator_spec.rb
123
+ - spec/generators/scaffold_generator_spec.rb
124
+ - spec/import_processor_spec.rb
125
+ - spec/rails_spec.rb
126
+ - spec/runtime_spec.rb
127
+ - spec/spec_helper.rb
128
+ - spec/sprockets_spec.rb
129
+ - spec/stylus_spec.rb
130
+ - spec/support/generators/test_case.rb
131
+ - spec/support/generators/tmp/app/controllers/posts_controller.rb
132
+ - spec/support/generators/tmp/app/helpers/posts_helper.rb
133
+ - spec/support/generators/tmp/config/routes.rb
134
+ - spec/support/helpers.rb
135
+ - spec/support/matchers.rb
136
+ - spec/tilt/rails_spec.rb
137
+ - spec/tilt/stylus_spec.rb