piano 0.10.2 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
data/bin/piano CHANGED
@@ -77,11 +77,11 @@ if File.exists?(File.expand_path(Dir.pwd) + "/Pianofile")
77
77
  load File.expand_path(Dir.pwd) + "/Pianofile"
78
78
  end
79
79
 
80
- if Dir.exist? "controllers"
80
+ if File.exist?("controllers") && File.directory?("controllers")
81
81
  puts "'controllers' directory found, loading '.controller' files"
82
82
  Piano::ControllerLoader.folder "controllers"
83
83
  end
84
84
 
85
85
  require "piano/routes"
86
86
 
87
- Piano::Base.play!
87
+ Piano::Base.play!
@@ -57,7 +57,7 @@ module Sinatra
57
57
 
58
58
  # Loads and parses the YAML data from the data directory
59
59
  def data_for(template)
60
- file_name = "#{pwd}/data/#{template}.yaml"
60
+ file_name = "#{settings.data}/#{template}.yaml"
61
61
  YAML.load_file(file_name) if File.exists?(file_name)
62
62
  end
63
63
 
@@ -112,10 +112,10 @@ module Sinatra
112
112
  #
113
113
  # => "Hello World!..."
114
114
  #
115
- def extract(text, length = 80)
116
- words = text.gsub(/<.+?>/, "").split
117
- return text if words.length <= length
118
- words[0..(length-1)].join(" ") + "..."
115
+ def extract(text, length = 80)
116
+ words = text.gsub(/<.+?>/, "").split
117
+ return text if words.length <= length
118
+ words[0..(length-1)].join(" ") + "..."
119
119
  end
120
120
 
121
121
  # Returns a url-friendly version of the given link, with a
@@ -132,12 +132,7 @@ module Sinatra
132
132
  #
133
133
  # You can specify a word length in the second argument.
134
134
  def link(text, length = 5)
135
- words = text
136
- .gsub(/<.+?>/, "")
137
- .gsub(" ", "-")
138
- .downcase
139
- .gsub(/[^a-z0-9\-]/, "")
140
- .split("-")
135
+ words = text.gsub(/<.+?>/, "").gsub(" ", "-").downcase.gsub(/[^a-z0-9\-]/, "").split("-")
141
136
  words[0..(length-1)].join("-")
142
137
  end
143
138
 
@@ -166,6 +161,7 @@ module Piano
166
161
 
167
162
  set :root, File.expand_path(Dir.pwd)
168
163
  set :views, File.expand_path(Dir.pwd)
164
+ set :data, File.expand_path(Dir.pwd + "/data")
169
165
  set :etags, :on
170
166
  set :i18n_path, File.expand_path(Dir.pwd) + "/config/locale"
171
167
 
@@ -187,4 +183,4 @@ module Piano
187
183
  end
188
184
  end
189
185
 
190
- require "piano/controllerloader"
186
+ require "piano/controllerloader"
@@ -1,7 +1,4 @@
1
1
  require "polyglot"
2
- require "rspec"
3
-
4
- include RSpec::Matchers
5
2
 
6
3
  module Piano
7
4
  # Controller loader especifically for polyglot
@@ -39,4 +36,4 @@ module Piano
39
36
  end
40
37
  end
41
38
 
42
- Polyglot.register "controller", Piano::PolyglotControllerLoader
39
+ Polyglot.register "controller", Piano::PolyglotControllerLoader
@@ -1,3 +1,3 @@
1
1
  module Piano
2
- VERSION = "0.10.2"
2
+ VERSION = "0.10.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-14 00:00:00.000000000 -03:00
13
- default_executable:
12
+ date: 2011-11-01 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: sinatra
17
- requirement: &22855200 !ruby/object:Gem::Requirement
16
+ requirement: &18672096 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ! '>='
@@ -22,10 +21,10 @@ dependencies:
22
21
  version: 1.2.6
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *22855200
24
+ version_requirements: *18672096
26
25
  - !ruby/object:Gem::Dependency
27
26
  name: haml
28
- requirement: &22854900 !ruby/object:Gem::Requirement
27
+ requirement: &18671700 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
31
30
  - - ! '>='
@@ -33,10 +32,10 @@ dependencies:
33
32
  version: 3.1.1
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: *22854900
35
+ version_requirements: *18671700
37
36
  - !ruby/object:Gem::Dependency
38
37
  name: sass
39
- requirement: &22854624 !ruby/object:Gem::Requirement
38
+ requirement: &18671004 !ruby/object:Gem::Requirement
40
39
  none: false
41
40
  requirements:
42
41
  - - ! '>='
@@ -44,10 +43,10 @@ dependencies:
44
43
  version: 3.1.1
45
44
  type: :runtime
46
45
  prerelease: false
47
- version_requirements: *22854624
46
+ version_requirements: *18671004
48
47
  - !ruby/object:Gem::Dependency
49
48
  name: coffee-script
50
- requirement: &22854348 !ruby/object:Gem::Requirement
49
+ requirement: &18670704 !ruby/object:Gem::Requirement
51
50
  none: false
52
51
  requirements:
53
52
  - - ! '>='
@@ -55,10 +54,10 @@ dependencies:
55
54
  version: 2.2.0
56
55
  type: :runtime
57
56
  prerelease: false
58
- version_requirements: *22854348
57
+ version_requirements: *18670704
59
58
  - !ruby/object:Gem::Dependency
60
59
  name: i18n
61
- requirement: &22854072 !ruby/object:Gem::Requirement
60
+ requirement: &18670428 !ruby/object:Gem::Requirement
62
61
  none: false
63
62
  requirements:
64
63
  - - ! '>='
@@ -66,10 +65,10 @@ dependencies:
66
65
  version: 0.6.0
67
66
  type: :runtime
68
67
  prerelease: false
69
- version_requirements: *22854072
68
+ version_requirements: *18670428
70
69
  - !ruby/object:Gem::Dependency
71
70
  name: polyglot
72
- requirement: &22853796 !ruby/object:Gem::Requirement
71
+ requirement: &18670044 !ruby/object:Gem::Requirement
73
72
  none: false
74
73
  requirements:
75
74
  - - ! '>='
@@ -77,10 +76,10 @@ dependencies:
77
76
  version: 0.3.1
78
77
  type: :runtime
79
78
  prerelease: false
80
- version_requirements: *22853796
79
+ version_requirements: *18670044
81
80
  - !ruby/object:Gem::Dependency
82
81
  name: metafun
83
- requirement: &22853568 !ruby/object:Gem::Requirement
82
+ requirement: &18669720 !ruby/object:Gem::Requirement
84
83
  none: false
85
84
  requirements:
86
85
  - - ! '>='
@@ -88,10 +87,10 @@ dependencies:
88
87
  version: '0'
89
88
  type: :runtime
90
89
  prerelease: false
91
- version_requirements: *22853568
90
+ version_requirements: *18669720
92
91
  - !ruby/object:Gem::Dependency
93
92
  name: rspec
94
- requirement: &22853292 !ruby/object:Gem::Requirement
93
+ requirement: &18669312 !ruby/object:Gem::Requirement
95
94
  none: false
96
95
  requirements:
97
96
  - - ! '>='
@@ -99,7 +98,7 @@ dependencies:
99
98
  version: '0'
100
99
  type: :development
101
100
  prerelease: false
102
- version_requirements: *22853292
101
+ version_requirements: *18669312
103
102
  description: Out-of-the-box sinatra server for web site sketching using haml + sass
104
103
  + coffee-script
105
104
  email:
@@ -124,7 +123,6 @@ files:
124
123
  - sample/index.haml
125
124
  - sample/style.sass
126
125
  - spec/controller_spec.rb
127
- has_rdoc: true
128
126
  homepage: http://github.com/xaviervia/piano
129
127
  licenses: []
130
128
  post_install_message:
@@ -145,9 +143,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
143
  version: '0'
146
144
  requirements: []
147
145
  rubyforge_project: piano
148
- rubygems_version: 1.5.2
146
+ rubygems_version: 1.8.11
149
147
  signing_key:
150
148
  specification_version: 3
151
149
  summary: Out-of-the-box sinatra server for web site sketching using haml + sass +
152
150
  coffee-script
153
151
  test_files: []
152
+ has_rdoc: