piano 0.7.4 → 0.7.5

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.
Files changed (4) hide show
  1. data/README.rdoc +2 -0
  2. data/bin/piano +15 -7
  3. data/lib/piano/version.rb +1 -1
  4. metadata +9 -9
@@ -84,6 +84,7 @@ Note: you can also add a <tt>server/folder/data/404.yaml</tt> file to keep layer
84
84
  * Port number: Any number passed as an argument to the <tt>piano</tt> command will be used as the port number.
85
85
  * Environment: Any string that does not matches any other argument will be setted as the environment.
86
86
  * <tt>noetags</tt>: Adding <tt>noetags</tt> to the shell command will cause Piano to run without etags.
87
+ * <tt>nocoffee</tt>: Adding <tt>nocoffee</tt> to the shell command will cause Piano to Not load the CoffeeScript library. Useful when no JavaScript environment is available.
87
88
 
88
89
  == Library Usage
89
90
 
@@ -185,6 +186,7 @@ Etags cause client side caching. This should not be a problem since the hash cha
185
186
  * Deploy of sample with command line <tt>--sample</tt> argument.
186
187
  * Online source files edition.
187
188
  * Test <tt>use Piano</tt> within a <tt>Sinatra::Base</tt> class.
189
+ * If CoffeeScript can't run, inform of the <tt>nocoffee</tt> command line option.
188
190
 
189
191
  * Now it would be nice to give Piano personalized templates not only to 404 but for all error pages, specially 500
190
192
  * Custom error when there's no data
data/bin/piano CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "piano"
4
-
5
3
  unless ARGV.empty?
6
4
 
5
+ args = {}
6
+
7
7
  ARGV.each do |arg|
8
8
  if arg =~ /^\d+$/
9
- Piano.port = arg
9
+ args[:port] = arg
10
10
  elsif arg =~ /^noetags$/
11
- Piano.etags = :off
12
- elsif arg =~ /^nocoffee%/
13
- $nocoffeescript = true
11
+ args[:etags] = :off
12
+ elsif arg =~ /^nocoffee/
13
+ $notcoffeescript = true
14
14
  elsif arg =~ /^sample$/
15
15
  puts "Warning: the sample site folder files will be created in the current directory."
16
16
  puts "Any files with the same name will be overwritten."
@@ -29,12 +29,20 @@ unless ARGV.empty?
29
29
  # end
30
30
  end
31
31
  elsif arg =~ /^[a-z]+$/
32
- Piano.environment = arg.to_sym
32
+ args[:environment] = arg.to_sym
33
33
  end
34
34
  end
35
35
 
36
36
  end
37
37
 
38
+ require "piano"
39
+
40
+ if args
41
+ Piano.port = args[:port] if args[:port]
42
+ Piano.environment = args[:environment] if args[:environment]
43
+ Piano.etags = args[:etags] if args[:etags]
44
+ end
45
+
38
46
  def make_sample
39
47
  require "fileutils"
40
48
 
@@ -1,3 +1,3 @@
1
1
  module Piano
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.5"
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.7.4
4
+ version: 0.7.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sinatra
17
- requirement: &21455076 !ruby/object:Gem::Requirement
17
+ requirement: &21716892 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.2.6
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *21455076
25
+ version_requirements: *21716892
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: haml
28
- requirement: &21454776 !ruby/object:Gem::Requirement
28
+ requirement: &21716592 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 3.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *21454776
36
+ version_requirements: *21716592
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: sass
39
- requirement: &21454500 !ruby/object:Gem::Requirement
39
+ requirement: &21716316 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 3.1.1
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *21454500
47
+ version_requirements: *21716316
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: coffee-script
50
- requirement: &21454224 !ruby/object:Gem::Requirement
50
+ requirement: &21716040 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: 2.2.0
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *21454224
58
+ version_requirements: *21716040
59
59
  description: Out-of-the-box sinatra server for web site sketching using haml + sass
60
60
  + coffee-script
61
61
  email: