pinion 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/pinion/bundle.rb CHANGED
@@ -15,14 +15,13 @@ module Pinion
15
15
 
16
16
  # Create a new `Bundle`.
17
17
  def initialize(bundle_type, name, paths)
18
- @bundle_type = bundle_type
19
18
  @name = name
20
19
  @paths = paths
21
20
  raise Error, "No paths provided" if paths.empty?
22
21
 
23
22
  @assets = paths.map do |path|
24
23
  asset = Asset[path]
25
- raise "Error: no such asset available: #{path}" unless asset
24
+ raise Error, "No such asset available: #{path}" unless asset
26
25
  asset
27
26
  end
28
27
  @extension = @assets.first.extension
@@ -96,6 +96,19 @@ module Pinion
96
96
  end
97
97
  end
98
98
 
99
+ Conversion.create :less => :css do
100
+ require_gem "less"
101
+ render do |file_contents, context|
102
+ load_paths = context[:load_paths].to_a || []
103
+ compress = Pinion.environment == "production"
104
+ Less::Parser.new(:paths => load_paths).parse(file_contents).to_css(:compress => compress)
105
+ end
106
+ watch do |path, context|
107
+ context[:load_paths] ||= Set.new
108
+ context[:load_paths] << path
109
+ end
110
+ end
111
+
99
112
  Conversion.create :coffee => :js do
100
113
  require_gem "coffee-script"
101
114
  render { |file_contents| CoffeeScript.compile(file_contents) }
data/lib/pinion/server.rb CHANGED
@@ -29,7 +29,7 @@ module Pinion
29
29
  end
30
30
  else
31
31
  unless Conversion[from_and_to]
32
- raise Error, "No immplicit conversion for #{from_and_to.inspect}. Must provide a conversion block."
32
+ raise Error, "No implicit conversion for #{from_and_to.inspect}. Must provide a conversion block."
33
33
  end
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module Pinion
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-17 00:00:00.000000000Z
12
+ date: 2012-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &26493960 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *26493960
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rake
27
- requirement: &26493500 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *26493500
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: yard
38
- requirement: &26493020 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *26493020
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: scope
49
- requirement: &26492500 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *26492500
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: rack-test
60
- requirement: &26492020 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *26492020
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: coffee-script
71
- requirement: &26491360 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: '0'
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *26491360
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: dedent
82
- requirement: &26490460 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,7 +117,12 @@ dependencies:
87
117
  version: '0'
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *26490460
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
91
126
  description: ! 'Pinion is a Rack application that you can use to compile and serve
92
127
  assets (such as Javascript and CSS).
93
128
 
@@ -111,7 +146,7 @@ files:
111
146
  - lib/pinion/version.rb
112
147
  - lib/pinion/static_asset.rb
113
148
  - lib/pinion.rb
114
- homepage: https://github.com/ooyala/pinion
149
+ homepage: https://github.com/cespare/pinion
115
150
  licenses: []
116
151
  post_install_message:
117
152
  rdoc_options: []
@@ -131,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
166
  version: '0'
132
167
  requirements: []
133
168
  rubyforge_project: pinion
134
- rubygems_version: 1.8.10
169
+ rubygems_version: 1.8.23
135
170
  signing_key:
136
171
  specification_version: 3
137
172
  summary: Pinion compiles and serves your assets