synfeld 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +9 -0
- data/Gemfile +4 -3
- data/README.rdoc +3 -11
- data/TODO +2 -1
- data/lib/synfeld/base.rb +3 -6
- data/synfeld.gemspec +5 -3
- metadata +78 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 88fc6eef82672917dc104658fc261ce5023b66e4
|
4
|
+
data.tar.gz: 32060353917564a05d078211aebe0f5343b67a09
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dade0de4276da1fb1c18d4b2f6a22496df72f7b94e05571e6d1cdd32f21b29e807134f7eae10f1738be09856dcb4da4c78dd4a468aab30a0edc97957e8b5f76b
|
7
|
+
data.tar.gz: 5a6f1a96174110abfb52497c013fe6087cdfe60054e154cb25dd2dc551974d8a635ec86fa9228bae2cd12d4271ed0db52a2629fbd6dc50f553ea1fcee7bd379f
|
data/.ruby-version
ADDED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -164,20 +164,12 @@ None known.
|
|
164
164
|
|
165
165
|
== Requirements
|
166
166
|
|
167
|
-
* ruby
|
168
|
-
* ruby,
|
169
|
-
* For rack-router, see http://github.com/carllerche/rack-router
|
167
|
+
* ruby 1.9.X
|
168
|
+
* ruby, rack, rack-mount
|
170
169
|
|
171
170
|
== Install
|
172
171
|
|
173
|
-
|
174
|
-
2. gem install josh-rack-mount --source=http://gems.github.com
|
175
|
-
3. gem install swerling-synfeld --source http://gems.github.com
|
176
|
-
|
177
|
-
(note: I noticed sometimes josh-rack-mount will complain about rack version
|
178
|
-
not being high enough, even if you are already on version 1.0.0. If that happens,
|
179
|
-
you have to clone the rack-mount repo locally and just build the rack-mount gem
|
180
|
-
yourself)
|
172
|
+
gem install synfeld
|
181
173
|
|
182
174
|
== License
|
183
175
|
|
data/TODO
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
routes busted since switch to rack-mount:
|
2
|
+
Try sinai's 'refresh' routes to see.
|
data/lib/synfeld/base.rb
CHANGED
@@ -72,17 +72,14 @@ module Synfeld # :nodoc:
|
|
72
72
|
# ROUTING
|
73
73
|
#
|
74
74
|
|
75
|
-
@@__regex_colon = (RUBY_VERSION =~ /^1.8/)? ':' : '' # :nodoc:
|
76
|
-
|
77
75
|
# See the README for a full explanation of how to use this method.
|
78
76
|
def add_route(string_or_regex, opts = {})
|
79
77
|
raise "You have to provide an :action method to call" unless opts[:action]
|
80
78
|
method = (opts.delete(:method) || 'GET').to_s.upcase
|
81
|
-
#
|
82
|
-
#
|
83
|
-
# bits to rack-mount variables.
|
79
|
+
# If a string, convert it to a rack-mount compatable regex, eg
|
80
|
+
# /some/:var/in/path => /some/(?<var>.*)/in/path
|
84
81
|
if string_or_regex.is_a?(String)
|
85
|
-
regex_string = "^" + string_or_regex.gsub(/:(([^\/]+))/){|s| "(
|
82
|
+
regex_string = "^" + string_or_regex.gsub(/:(([^\/]+))/){|s| "(?<#{$1}>.*)" } + "$"
|
86
83
|
regex = %r{#{regex_string}}
|
87
84
|
#puts regex_string # dbg
|
88
85
|
else
|
data/synfeld.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "synfeld"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.7"
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["Steven Swerling"]
|
8
8
|
s.email = "sswerling@yahoo.com"
|
@@ -47,6 +47,8 @@ code below, you have to look at the template file
|
|
47
47
|
#s.add_development_dependency "rake"
|
48
48
|
|
49
49
|
# Cant seem to get bundler to work if I add these 2:
|
50
|
-
|
51
|
-
|
50
|
+
s.add_dependency 'rack', '~> 1.4.1'
|
51
|
+
s.add_dependency 'rack-mount', '~> 0.8.3'
|
52
|
+
s.add_dependency 'haml', '~> 3.1.6'
|
53
|
+
|
52
54
|
end
|
metadata
CHANGED
@@ -1,28 +1,80 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synfeld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.7
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Steven Swerling
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
11
|
+
date: 2015-02-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.4.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.4.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack-mount
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: haml
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.1.6
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.1.6
|
55
|
+
description: |2
|
56
|
+
|
57
|
+
Synfeld is a web application framework that does practically nothing.
|
58
|
+
|
59
|
+
Synfeld is little more than a small wrapper for Rack::Mount (see
|
60
|
+
http://github.com/josh/rack-mount). If you want a web framework that is
|
61
|
+
mostly just going to serve up json blobs, and occasionally serve up some
|
62
|
+
simple content (eg. help files) and media, Synfeld makes that easy.
|
63
|
+
|
64
|
+
The sample app below shows pretty much everything there is to know about
|
65
|
+
synfeld, in particular:
|
66
|
+
|
67
|
+
* How to define routes.
|
68
|
+
* Simple rendering of erb, haml, html, json, and static files.
|
69
|
+
* In the case of erb and haml, passing variables into the template is
|
70
|
+
demonstrated.
|
71
|
+
* A dynamic action where the status code, headers, and body are created
|
72
|
+
'manually' (/my/special/route below)
|
73
|
+
* A simple way of creating format sensitive routes (/alphabet.html vs.
|
74
|
+
/alphabet.json)
|
75
|
+
* The erb demo link also demos the rendering of a partial (not visible in the
|
76
|
+
code below, you have to look at the template file
|
77
|
+
examples/public/erb_files/erb_test.erb).
|
26
78
|
email: sswerling@yahoo.com
|
27
79
|
executables: []
|
28
80
|
extensions: []
|
@@ -31,8 +83,9 @@ extra_rdoc_files:
|
|
31
83
|
- README.rdoc
|
32
84
|
- README.txt
|
33
85
|
files:
|
34
|
-
- .bnsignore
|
35
|
-
- .gitignore
|
86
|
+
- ".bnsignore"
|
87
|
+
- ".gitignore"
|
88
|
+
- ".ruby-version"
|
36
89
|
- Gemfile
|
37
90
|
- History.txt
|
38
91
|
- README.rdoc
|
@@ -56,33 +109,29 @@ files:
|
|
56
109
|
- work/rackmount-test.ru
|
57
110
|
homepage: http://github.com/swerling/synfeld
|
58
111
|
licenses: []
|
112
|
+
metadata: {}
|
59
113
|
post_install_message:
|
60
114
|
rdoc_options:
|
61
|
-
- --inline-source
|
62
|
-
- --main
|
115
|
+
- "--inline-source"
|
116
|
+
- "--main"
|
63
117
|
- README.txt
|
64
118
|
require_paths:
|
65
119
|
- lib
|
66
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
121
|
requirements:
|
69
|
-
- -
|
122
|
+
- - ">="
|
70
123
|
- !ruby/object:Gem::Version
|
71
124
|
version: '0'
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
hash: 288883825
|
75
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
126
|
requirements:
|
78
|
-
- -
|
127
|
+
- - ">="
|
79
128
|
- !ruby/object:Gem::Version
|
80
129
|
version: '0'
|
81
130
|
requirements: []
|
82
131
|
rubyforge_project: synfeld
|
83
|
-
rubygems_version:
|
132
|
+
rubygems_version: 2.2.2
|
84
133
|
signing_key:
|
85
|
-
specification_version:
|
134
|
+
specification_version: 4
|
86
135
|
summary: Synfeld is a web application framework that does practically nothing
|
87
136
|
test_files:
|
88
137
|
- test/test_synfeld.rb
|