sinatra_more 0.3.21 → 0.3.22
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.
- data/IDEAS.md +54 -0
- data/VERSION +1 -1
- data/lib/sinatra_more/markup_plugin/asset_tag_helpers.rb +2 -2
- data/sinatra_more.gemspec +3 -2
- data/test/markup_plugin/test_asset_tag_helpers.rb +11 -0
- metadata +3 -2
data/IDEAS.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# sinatra_more Ideas
|
2
|
+
|
3
|
+
before/after filters only for certain routes:
|
4
|
+
|
5
|
+
before :only => [:show, "/account"] do
|
6
|
+
# ... actions ...
|
7
|
+
end
|
8
|
+
|
9
|
+
after :only => [:show, "/account"] do
|
10
|
+
# ... actions ...
|
11
|
+
end
|
12
|
+
|
13
|
+
resource routing (defines mapped routes)
|
14
|
+
|
15
|
+
map(:user).resource
|
16
|
+
# => EQUIVALENT TO:
|
17
|
+
map(:new_user).to('/users/new') # NEW
|
18
|
+
map(:edit_user).to('/user/:id/edit') # EDIT
|
19
|
+
map(:user).to('/user/:id') # SHOW, UPDATE, DESTROY
|
20
|
+
map(:users).to('/users') # INDEX, CREATE
|
21
|
+
|
22
|
+
benchmarking and logging
|
23
|
+
|
24
|
+
create logger and Sinatra.logger methods
|
25
|
+
to make logging with severity easy
|
26
|
+
|
27
|
+
Sinatra.logger.info "Print something to log"
|
28
|
+
|
29
|
+
model generators (creates model, test, migrate)
|
30
|
+
|
31
|
+
sinatra_gen model Article
|
32
|
+
sinatra_gen --destroy model Article
|
33
|
+
|
34
|
+
migration generator (creates migration file)
|
35
|
+
|
36
|
+
sinatra_gen migration CreateArticleIndices
|
37
|
+
|
38
|
+
controller generators (routes, test, helpers)
|
39
|
+
|
40
|
+
sinatra_gen controller articles
|
41
|
+
sinatra_gen --destroy controller articles
|
42
|
+
|
43
|
+
mailer generators (mailer file, view path, test)
|
44
|
+
|
45
|
+
sinatra_gen mailer UserNotifier confirmation
|
46
|
+
|
47
|
+
task support (in generated app)
|
48
|
+
|
49
|
+
padrino console
|
50
|
+
padrino test
|
51
|
+
padrino db:create
|
52
|
+
padrino db:migrate
|
53
|
+
|
54
|
+
(Note in mailers, check out adv\_attr\_accessor)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.22
|
@@ -80,14 +80,14 @@ module SinatraMore
|
|
80
80
|
|
81
81
|
def javascript_path(source)
|
82
82
|
return source if source =~ /^http/
|
83
|
-
result_path = "/javascripts/#{
|
83
|
+
result_path = "/javascripts/#{source.gsub(/.js/, '')}.js"
|
84
84
|
stamp = File.exist?(result_path) ? File.mtime(result_path) : Time.now.to_i
|
85
85
|
"#{result_path}?#{stamp}"
|
86
86
|
end
|
87
87
|
|
88
88
|
def stylesheet_path(source)
|
89
89
|
return source if source =~ /^http/
|
90
|
-
result_path = "/stylesheets/#{
|
90
|
+
result_path = "/stylesheets/#{source.gsub(/.css/, '')}.css"
|
91
91
|
stamp = File.exist?(result_path) ? File.mtime(result_path) : Time.now.to_i
|
92
92
|
"#{result_path}?#{stamp}"
|
93
93
|
end
|
data/sinatra_more.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sinatra_more}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.22"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nathan Esquenazi"]
|
12
|
-
s.date = %q{2009-11-
|
12
|
+
s.date = %q{2009-11-19}
|
13
13
|
s.default_executable = %q{sinatra_gen}
|
14
14
|
s.description = %q{Expands sinatra with standard helpers and tools to allow for complex applications}
|
15
15
|
s.email = %q{nesquena@gmail.com}
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
23
|
".gitignore",
|
24
|
+
"IDEAS.md",
|
24
25
|
"LICENSE",
|
25
26
|
"README.rdoc",
|
26
27
|
"ROADMAP",
|
@@ -99,6 +99,12 @@ class TestAssetTagHelpers < Test::Unit::TestCase
|
|
99
99
|
expected_options = { :media => "screen", :rel => "stylesheet", :type => "text/css" }
|
100
100
|
assert_has_tag('link', expected_options.merge(:href => "/stylesheets/style.css?#{time.to_i}")) { stylesheet_link_tag('style') }
|
101
101
|
end
|
102
|
+
should "display stylesheet link item for long relative path" do
|
103
|
+
time = stop_time_for_test
|
104
|
+
expected_options = { :media => "screen", :rel => "stylesheet", :type => "text/css" }
|
105
|
+
actual_html = stylesheet_link_tag('example/demo/style')
|
106
|
+
assert_has_tag('link', expected_options.merge(:href => "/stylesheets/example/demo/style.css?#{time.to_i}")) { actual_html }
|
107
|
+
end
|
102
108
|
should "display stylesheet link items" do
|
103
109
|
time = stop_time_for_test
|
104
110
|
actual_html = stylesheet_link_tag('style', 'layout.css', 'http://google.com/style.css')
|
@@ -115,6 +121,11 @@ class TestAssetTagHelpers < Test::Unit::TestCase
|
|
115
121
|
actual_html = javascript_include_tag('application')
|
116
122
|
assert_has_tag('script', :src => "/javascripts/application.js?#{time.to_i}", :type => "text/javascript") { actual_html }
|
117
123
|
end
|
124
|
+
should "display javascript item for long relative path" do
|
125
|
+
time = stop_time_for_test
|
126
|
+
actual_html = javascript_include_tag('example/demo/application')
|
127
|
+
assert_has_tag('script', :src => "/javascripts/example/demo/application.js?#{time.to_i}", :type => "text/javascript") { actual_html }
|
128
|
+
end
|
118
129
|
should "display javascript items" do
|
119
130
|
time = stop_time_for_test
|
120
131
|
actual_html = javascript_include_tag('application', 'base.js', 'http://google.com/lib.js')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra_more
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Esquenazi
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-19 00:00:00 -08:00
|
13
13
|
default_executable: sinatra_gen
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -124,6 +124,7 @@ extra_rdoc_files:
|
|
124
124
|
files:
|
125
125
|
- .document
|
126
126
|
- .gitignore
|
127
|
+
- IDEAS.md
|
127
128
|
- LICENSE
|
128
129
|
- README.rdoc
|
129
130
|
- ROADMAP
|