picky-generators 3.0.0.pre3 → 3.0.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/picky-generators/generators/all_in_one/sinatra.rb +42 -0
- data/lib/picky-generators/generators/selector.rb +3 -3
- data/lib/picky-generators.rb +2 -0
- data/prototypes/all_in_one/sinatra/Gemfile +34 -0
- data/prototypes/all_in_one/sinatra/Rakefile +6 -0
- data/prototypes/all_in_one/sinatra/app.rb +116 -0
- data/prototypes/all_in_one/sinatra/book.rb +42 -0
- data/prototypes/all_in_one/sinatra/config.ru +14 -0
- data/prototypes/all_in_one/sinatra/images/picky.png +0 -0
- data/prototypes/all_in_one/sinatra/javascripts/history.adapter.jquery.min.js +6 -0
- data/prototypes/all_in_one/sinatra/javascripts/history.min.js +6 -0
- data/prototypes/all_in_one/sinatra/javascripts/jquery-1.5.0.min.js +16 -0
- data/prototypes/all_in_one/sinatra/javascripts/picky.min.js +17 -0
- data/prototypes/all_in_one/sinatra/library.csv +540 -0
- data/prototypes/all_in_one/sinatra/log/README +0 -0
- data/prototypes/all_in_one/sinatra/logging.rb +24 -0
- data/prototypes/all_in_one/sinatra/stylesheets/application.css +22 -0
- data/prototypes/all_in_one/sinatra/stylesheets/picky.css +135 -0
- data/prototypes/all_in_one/sinatra/views/configure.haml +162 -0
- data/prototypes/all_in_one/sinatra/views/search.haml +138 -0
- data/prototypes/client/sinatra/Gemfile +1 -1
- data/prototypes/client/sinatra/app.rb +2 -2
- data/prototypes/server/classic/Gemfile +2 -2
- data/prototypes/server/sinatra/Gemfile +2 -2
- data/prototypes/server/sinatra/config.ru +1 -1
- data/spec/lib/picky-generators/generators/selector_spec.rb +3 -0
- metadata +21 -3
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Separate file since this is usually what is
|
2
|
+
# environment specific.
|
3
|
+
# (But go ahead and place the code in app.rb if you wish)
|
4
|
+
#
|
5
|
+
|
6
|
+
# Standard logging.
|
7
|
+
#
|
8
|
+
require 'logger'
|
9
|
+
AppLogger = Logger.new File.expand_path('log/search.log', PICKY_ROOT)
|
10
|
+
|
11
|
+
# Example with using the syslog logger.
|
12
|
+
# Falling back to the standard log if it isn't available.
|
13
|
+
# (For example, because it is used locally and syslog is
|
14
|
+
# only available on the servers)
|
15
|
+
#
|
16
|
+
# begin
|
17
|
+
# log_program_name = 'search/query'
|
18
|
+
# AppLogger = SyslogLogger.new log_program_name
|
19
|
+
# puts "Logging on syslog #{log_program_name}."
|
20
|
+
# rescue StandardError
|
21
|
+
# puts "Could not connect to the syslog, using the normal log."
|
22
|
+
# require 'logger'
|
23
|
+
# AppLogger = Logger.new(File.join(PICKY_ROOT, 'log/search.log'))
|
24
|
+
# end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
body {
|
2
|
+
text-align: center;
|
3
|
+
font-family: Lucida Grande; }
|
4
|
+
body .content {
|
5
|
+
width: 560px;
|
6
|
+
margin: 0 auto;
|
7
|
+
text-align: left; }
|
8
|
+
|
9
|
+
img {
|
10
|
+
margin: 0px 0px -210px; }
|
11
|
+
|
12
|
+
p span.explanation {
|
13
|
+
color: #999999; }
|
14
|
+
|
15
|
+
pre {
|
16
|
+
padding: 10px;
|
17
|
+
background-color: #efede5; }
|
18
|
+
|
19
|
+
#picky ol.results li.book {
|
20
|
+
background-color: #ffeeee;
|
21
|
+
padding: 5px 25px;
|
22
|
+
margin: 3px 0px; }
|
@@ -0,0 +1,135 @@
|
|
1
|
+
#picky {
|
2
|
+
overflow: hidden; }
|
3
|
+
#picky > div.header {
|
4
|
+
display: none; }
|
5
|
+
#picky div.dashboard {
|
6
|
+
position: relative;
|
7
|
+
overflow: hidden;
|
8
|
+
background-color: lightGrey;
|
9
|
+
padding: 5px 5px 7px 5px;
|
10
|
+
height: 26px;
|
11
|
+
margin-bottom: 3px; }
|
12
|
+
#picky div.dashboard.empty .status {
|
13
|
+
background-color: #8cacda; }
|
14
|
+
#picky div.dashboard.empty .feedback {
|
15
|
+
background-color: #d0e2ff; }
|
16
|
+
#picky div.dashboard.none .status {
|
17
|
+
background-color: red; }
|
18
|
+
#picky div.dashboard.none .feedback {
|
19
|
+
background-color: #ffdddd; }
|
20
|
+
#picky div.dashboard.support .status {
|
21
|
+
background-color: #ff6600; }
|
22
|
+
#picky div.dashboard.support .feedback {
|
23
|
+
background-color: #faf3d0; }
|
24
|
+
#picky div.dashboard.ok .status {
|
25
|
+
background-color: #09be01; }
|
26
|
+
#picky div.dashboard.ok .feedback {
|
27
|
+
background-color: #bcf0b3; }
|
28
|
+
#picky div.dashboard .feedback {
|
29
|
+
width: 85%;
|
30
|
+
float: left;
|
31
|
+
border: 1px solid #cccccc;
|
32
|
+
padding: 0;
|
33
|
+
margin: 0; }
|
34
|
+
#picky div.dashboard .feedback .status {
|
35
|
+
float: left;
|
36
|
+
width: 45px;
|
37
|
+
height: 26px;
|
38
|
+
line-height: 26px;
|
39
|
+
text-align: center;
|
40
|
+
padding: 0 0 0 2px;
|
41
|
+
font-weight: bold;
|
42
|
+
color: white;
|
43
|
+
margin-right: 5px; }
|
44
|
+
#picky div.dashboard .feedback .status.alert {
|
45
|
+
background-color: lightgreen; }
|
46
|
+
#picky div.dashboard .feedback input.query {
|
47
|
+
float: left;
|
48
|
+
width: 80%;
|
49
|
+
height: 100%;
|
50
|
+
font-size: 1em;
|
51
|
+
font-weight: bold;
|
52
|
+
border-style: solid;
|
53
|
+
border-width: 0px 0px 3px 0px;
|
54
|
+
border-color: transparent;
|
55
|
+
margin: 0;
|
56
|
+
padding: 4px 0 0 0;
|
57
|
+
outline: none;
|
58
|
+
background: none; }
|
59
|
+
#picky div.dashboard .feedback .reset {
|
60
|
+
float: right;
|
61
|
+
width: 18px;
|
62
|
+
height: 18px;
|
63
|
+
margin: 3px 3px 0px 0px;
|
64
|
+
cursor: pointer;
|
65
|
+
opacity: 0; }
|
66
|
+
#picky div.dashboard input.search_button {
|
67
|
+
margin: 5px 0px 5px 2%; }
|
68
|
+
#picky div.results {
|
69
|
+
margin-top: 0px;
|
70
|
+
padding: 0px; }
|
71
|
+
#picky div.results div.header, #picky div.results div.addination {
|
72
|
+
color: #555555;
|
73
|
+
background-color: #eeeeee;
|
74
|
+
padding: 6px 5px 5px 8px; }
|
75
|
+
#picky div.results div.header .tothetop, #picky div.results div.addination .tothetop {
|
76
|
+
float: right; }
|
77
|
+
#picky div.results div.header .tothetop a, #picky div.results div.addination .tothetop a {
|
78
|
+
display: block;
|
79
|
+
width: 20px;
|
80
|
+
height: 20px; }
|
81
|
+
#picky div.results ol.results {
|
82
|
+
list-style-type: none;
|
83
|
+
padding: 0px;
|
84
|
+
margin: 0px; }
|
85
|
+
#picky div.results div.addination {
|
86
|
+
position: relative;
|
87
|
+
text-align: center;
|
88
|
+
color: #276abb;
|
89
|
+
cursor: pointer; }
|
90
|
+
#picky .no_results {
|
91
|
+
display: none; }
|
92
|
+
#picky .allocations {
|
93
|
+
clear: both;
|
94
|
+
overflow: hidden;
|
95
|
+
background-color: white;
|
96
|
+
padding-bottom: 2px; }
|
97
|
+
#picky .allocations ol.hidden {
|
98
|
+
display: none; }
|
99
|
+
#picky .allocations ol.more:hover {
|
100
|
+
background-color: #cccccc;
|
101
|
+
cursor: pointer; }
|
102
|
+
#picky .allocations ol.more {
|
103
|
+
background-color: #eeeeee;
|
104
|
+
display: none;
|
105
|
+
text-align: center;
|
106
|
+
height: 32px;
|
107
|
+
line-height: 32px; }
|
108
|
+
#picky .allocations ol.more li {
|
109
|
+
text-align: center; }
|
110
|
+
#picky .allocations ol {
|
111
|
+
list-style-position: outside;
|
112
|
+
list-style: none;
|
113
|
+
padding: 0;
|
114
|
+
margin: 0px;
|
115
|
+
overflow: hidden; }
|
116
|
+
#picky .allocations ol li {
|
117
|
+
margin: 0px;
|
118
|
+
margin-bottom: 3px;
|
119
|
+
padding: 10px 13px;
|
120
|
+
cursor: pointer;
|
121
|
+
display: block;
|
122
|
+
font: menu;
|
123
|
+
font-size: 1em;
|
124
|
+
line-height: 16px;
|
125
|
+
background-color: #f3f3f3;
|
126
|
+
overflow: hidden;
|
127
|
+
color: #276abb; }
|
128
|
+
#picky .allocations ol li .text {
|
129
|
+
max-width: 90%;
|
130
|
+
float: left; }
|
131
|
+
#picky .allocations ol li .count {
|
132
|
+
float: right;
|
133
|
+
color: #cccccc; }
|
134
|
+
#picky .allocations ol li:hover {
|
135
|
+
background-color: #d0e2ff; }
|
@@ -0,0 +1,162 @@
|
|
1
|
+
!!!
|
2
|
+
%html{ :lang => 'en' }
|
3
|
+
%head
|
4
|
+
%link{:href => "stylesheets/stylesheet.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/
|
5
|
+
%body
|
6
|
+
%img{:src => "images/picky.png"}/
|
7
|
+
%p
|
8
|
+
%a{:href => "http://floere.github.com/picky"} To the Picky Homepage
|
9
|
+
\/
|
10
|
+
%a{:href => '/' } Back to the example
|
11
|
+
.content
|
12
|
+
%h1 Already made it this far? You're good!
|
13
|
+
%p I think you're ready for configuring me for your own purposes.
|
14
|
+
%h2 Configuring the Picky client.
|
15
|
+
%p
|
16
|
+
There are two places where you configure the Picky client:
|
17
|
+
%ol
|
18
|
+
%li
|
19
|
+
%a{ :href => '#controller' } In the controller.
|
20
|
+
(client to Picky server)
|
21
|
+
%li
|
22
|
+
%a{ :href => '#view' } In the view.
|
23
|
+
(javascript client interface)
|
24
|
+
%h2#controller Controller
|
25
|
+
%p
|
26
|
+
Open the file
|
27
|
+
%strong app.rb
|
28
|
+
and take a peek inside.
|
29
|
+
%p
|
30
|
+
First you need a client instance.
|
31
|
+
%p
|
32
|
+
In the example, I called it
|
33
|
+
%strong BookSearch
|
34
|
+
respectively.
|
35
|
+
%code
|
36
|
+
%pre
|
37
|
+
:preserve
|
38
|
+
BookSearch = Picky::Client.new :host => 'localhost', :port => 8080, :path => '/books'
|
39
|
+
%p
|
40
|
+
Both clients offer the options:
|
41
|
+
%dl
|
42
|
+
%dt
|
43
|
+
%strong host
|
44
|
+
%dd The Picky search server host.
|
45
|
+
%dt
|
46
|
+
%strong port
|
47
|
+
%dd The Picky search server port (see unicorn.rb in the server).
|
48
|
+
%dt
|
49
|
+
%strong path
|
50
|
+
%dd The Picky search path (see app/application.rb in the server for the mapping path => query).
|
51
|
+
%p
|
52
|
+
Then, use these Client instances in your actions. For example like this:
|
53
|
+
%code
|
54
|
+
%pre
|
55
|
+
:preserve
|
56
|
+
get '/search/full' do
|
57
|
+
results = BookSearch.search params[:query], :ids => params[:ids], :offset => params[:offset]
|
58
|
+
results.extend Picky::Convenience
|
59
|
+
results.populate_with Book do |book|
|
60
|
+
book.to_s
|
61
|
+
end
|
62
|
+
ActiveSupport::JSON.encode results
|
63
|
+
end
|
64
|
+
%p
|
65
|
+
This part gets a
|
66
|
+
%strong hash
|
67
|
+
with the results:
|
68
|
+
%code
|
69
|
+
%pre results = BookSearch.search params[:query], :ids => params[:ids], :offset => params[:offset]
|
70
|
+
%p
|
71
|
+
This part takes the
|
72
|
+
%strong hash
|
73
|
+
and extends it with a few useful and convenient methods:
|
74
|
+
%code
|
75
|
+
%pre results.extend Picky::Convenience
|
76
|
+
%p
|
77
|
+
One of these methods is the
|
78
|
+
%strong populate_with
|
79
|
+
method which takes a
|
80
|
+
%strong model
|
81
|
+
as parameter, and then gets the corresponding
|
82
|
+
%strong model instances
|
83
|
+
for each id in the result.
|
84
|
+
%code
|
85
|
+
%pre
|
86
|
+
:preserve
|
87
|
+
results.populate_with Book do |book|
|
88
|
+
book.to_s
|
89
|
+
end
|
90
|
+
The
|
91
|
+
%strong book.to_s
|
92
|
+
simulates rendering a book.
|
93
|
+
You can do whatever with the book instance if you just return a rendered thing that's supposed to be shown in the front end.
|
94
|
+
%p
|
95
|
+
If you don't want to render in the controller, you can do so in a view. In the controller just call
|
96
|
+
%code
|
97
|
+
%pre
|
98
|
+
results.populate_with Book
|
99
|
+
and then render the books in a view using:
|
100
|
+
%code
|
101
|
+
%pre
|
102
|
+
:preserve
|
103
|
+
results.entries do |book|
|
104
|
+
render book # or book.to_s, or however you like to render the book.
|
105
|
+
end
|
106
|
+
%p
|
107
|
+
At the end, encode the hash in JSON:
|
108
|
+
%code
|
109
|
+
%pre
|
110
|
+
ActiveSupport::JSON.encode results
|
111
|
+
That's it for the controller.
|
112
|
+
%p
|
113
|
+
All the steps in one:
|
114
|
+
%code
|
115
|
+
%pre
|
116
|
+
:preserve
|
117
|
+
BookSearch = Picky::Client.new :host => 'localhost', :port => 8080, :path => '/books'
|
118
|
+
|
119
|
+
get '/search/full' do
|
120
|
+
results = BookSearch.search params[:query], :ids => params[:ids], :offset => params[:offset]
|
121
|
+
|
122
|
+
results.extend Picky::Convenience
|
123
|
+
results.populate_with Book do |book|
|
124
|
+
book.to_s
|
125
|
+
end
|
126
|
+
|
127
|
+
ActiveSupport::JSON.encode results
|
128
|
+
end
|
129
|
+
%h2#view View
|
130
|
+
%p
|
131
|
+
The view is even easier. Just add the line
|
132
|
+
%code
|
133
|
+
%pre
|
134
|
+
\= Picky::Helper.cached_interface
|
135
|
+
if you use just one language, or
|
136
|
+
%code
|
137
|
+
%pre
|
138
|
+
\= Picky::Helper.interface :button => 'search', :no_results => 'No results!', :more => 'more'
|
139
|
+
if you use multiple languages.
|
140
|
+
(You'd use the options
|
141
|
+
%pre :button => t(:'search.button'), :no_results => t(:'search.no_results'), :more => t(:'search.more')
|
142
|
+
of course, with proper i18n)
|
143
|
+
The same options can be used for
|
144
|
+
%strong #cached_interface
|
145
|
+
but they will be cached, so you can only set them once and then reused.
|
146
|
+
%p
|
147
|
+
You're almost finished. Take a look at the file
|
148
|
+
%strong views/search.haml
|
149
|
+
where you'll find javascript at the end. It looks something like this:
|
150
|
+
%code
|
151
|
+
%pre
|
152
|
+
:preserve
|
153
|
+
:javascript
|
154
|
+
pickyClient = new PickyClient({
|
155
|
+
// A full query displays the rendered results.
|
156
|
+
//
|
157
|
+
full: '/search/full',
|
158
|
+
|
159
|
+
// etc.
|
160
|
+
Just take a look at the possible javascript client options in that file.
|
161
|
+
%p
|
162
|
+
%strong Good luck my friend! *waves several stubby pink tentacles*
|
@@ -0,0 +1,138 @@
|
|
1
|
+
!!!
|
2
|
+
%html{ :lang => 'en' }
|
3
|
+
%head
|
4
|
+
%link{:href => "stylesheets/picky.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/
|
5
|
+
%link{:href => "stylesheets/application.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/
|
6
|
+
|
7
|
+
= js 'jquery-1.5.0.min'
|
8
|
+
= js 'history.min'
|
9
|
+
= js 'history.adapter.jquery.min'
|
10
|
+
= js 'picky.min'
|
11
|
+
|
12
|
+
%body
|
13
|
+
%img{:src => "images/picky.png"}/
|
14
|
+
%p
|
15
|
+
%a{:href => "http://floere.github.com/picky"} To the Picky Homepage
|
16
|
+
\/
|
17
|
+
%a{:href => '/configure' } Configuring this app server
|
18
|
+
%p
|
19
|
+
Try a few examples
|
20
|
+
= succeed ":" do
|
21
|
+
%span.explanation (on a simple database with 540 books - note that the server is on Heroku and needs a little time to ramp up)
|
22
|
+
%p
|
23
|
+
A simple word,
|
24
|
+
= succeed "." do
|
25
|
+
%a{:href => "#", :onclick => "pickyClient.insert('alan');"} alan
|
26
|
+
%span.explanation
|
27
|
+
(Finds Alan in the title, and Alans who wrote books. The title is ranked higher due to weighing.)
|
28
|
+
%span
|
29
|
+
%p
|
30
|
+
With qualifier,
|
31
|
+
= succeed "." do
|
32
|
+
%a{:href => "#", :onclick => "pickyClient.insert('title:women');"} title:women
|
33
|
+
%span.explanation
|
34
|
+
(Finds "women*" just in titles.)
|
35
|
+
%span
|
36
|
+
%p
|
37
|
+
With similarity,
|
38
|
+
= succeed "." do
|
39
|
+
%a{:href => "#", :onclick => "pickyClient.insert('pinchn~');"} pinchn~
|
40
|
+
%span.explanation (Finds "pynchon", note: Only title in example with similarity. Uses a combination of double metaphone and Levenshtein.)
|
41
|
+
%p
|
42
|
+
More complex,
|
43
|
+
= succeed "." do
|
44
|
+
%a{:href => "#", :onclick => "pickyClient.insert('title:lyterature~');"} title:lyterature~
|
45
|
+
%span.explanation (Finds similar titles)
|
46
|
+
%p
|
47
|
+
With choice,
|
48
|
+
= succeed "." do
|
49
|
+
%a{:href => "#", :onclick => "pickyClient.insert('sp');"} sp
|
50
|
+
%span.explanation (Finds "sp*" in multiple categories. Choose the one you're looking for.)
|
51
|
+
%p
|
52
|
+
More complex,
|
53
|
+
= succeed "." do
|
54
|
+
%a{:href => "#", :onclick => "pickyClient.insert('soc* p');"} soc* p
|
55
|
+
%span.explanation (This is where Picky really shines, "the title started with soc, and the author starts with p")
|
56
|
+
.content
|
57
|
+
= Picky::Helper.cached_interface
|
58
|
+
:javascript
|
59
|
+
$(window).load(function() {
|
60
|
+
pickyClient = new PickyClient({
|
61
|
+
// A full query displays the rendered results.
|
62
|
+
//
|
63
|
+
full: '/search/full',
|
64
|
+
// fullResults: 100, // Optional. Amount of ids to search for, default 20.
|
65
|
+
|
66
|
+
// A live query just updates the count and does not need
|
67
|
+
// to render (could go straight to the search server).
|
68
|
+
//
|
69
|
+
live: '/search/live',
|
70
|
+
// liveResults: 0, // Optional. Amount of ids to search for, default 0.
|
71
|
+
|
72
|
+
// showResultsLimit: 10, // Optional. Default is 10.
|
73
|
+
|
74
|
+
// Wrap each li group (like author-title, or title-isbn etc.) of results
|
75
|
+
// in this element.
|
76
|
+
// Optional. Default is '<ol class="results"></ol>'.
|
77
|
+
//
|
78
|
+
// wrapResults: '<div class="hello"><ol class="world"></ol></div>',
|
79
|
+
|
80
|
+
// before: function(params, query) { }, // Optional. Before Picky sends any data.
|
81
|
+
// success: function(data, query) { }, // Optional. Just after Picky receives data. (Get a PickyData object)
|
82
|
+
// after: function(data, query) { }, // Optional. After Picky has handled the data and updated the view.
|
83
|
+
|
84
|
+
// This is used to generate the correct query strings, localized. E.g. "subject:war".
|
85
|
+
// Optional. If you don't give these, the field identifier given in the Picky server is used.
|
86
|
+
//
|
87
|
+
qualifiers: {
|
88
|
+
en:{
|
89
|
+
subjects: 'subject'
|
90
|
+
}
|
91
|
+
},
|
92
|
+
|
93
|
+
// Use this to group the choices (those are used when Picky needs more feedback).
|
94
|
+
// If a category is missing, it is appended in a virtual group at the end.
|
95
|
+
// Optional. Default is [].
|
96
|
+
//
|
97
|
+
groups: [['author', 'title', 'subjects']],
|
98
|
+
// This is used for formatting inside the choice groups.
|
99
|
+
//
|
100
|
+
// Use %n$s, where n is the position of the category in the key.
|
101
|
+
// Optional. Default is {}.
|
102
|
+
//
|
103
|
+
choices: {
|
104
|
+
en:{
|
105
|
+
'title': {
|
106
|
+
format: "<strong>%1$s</strong>",
|
107
|
+
filter: function(text) { return text.toUpperCase(); },
|
108
|
+
ignoreSingle: false
|
109
|
+
},
|
110
|
+
'author,title': '%1$s, who wrote %2$s',
|
111
|
+
'title,author': '%2$s, written by %2$s',
|
112
|
+
'title,subjects': '%1$s, about %2$s',
|
113
|
+
'author,subjects': '%1$s, who wrote about %2$s'
|
114
|
+
}
|
115
|
+
},
|
116
|
+
|
117
|
+
// This is used to explain the preceding word in the suggestion text (if it
|
118
|
+
// has not yet been defined by the choices above), localized. E.g. "Peter (author)".
|
119
|
+
// Optional. Default are the field identifiers from the Picky server.
|
120
|
+
//
|
121
|
+
explanations: {
|
122
|
+
en:{
|
123
|
+
title: 'titled',
|
124
|
+
author: 'written by',
|
125
|
+
year: 'published in'
|
126
|
+
// publisher: 'published by',
|
127
|
+
// subjects: 'topics'
|
128
|
+
}
|
129
|
+
}
|
130
|
+
});
|
131
|
+
|
132
|
+
// An initial search text, prefilled
|
133
|
+
// this one is passed through the query param q.
|
134
|
+
//
|
135
|
+
// Example: www.mysearch.com/?q=example
|
136
|
+
//
|
137
|
+
pickyClient.insertFromURL('#{@query}');
|
138
|
+
});
|
@@ -6,12 +6,12 @@ Bundler.require
|
|
6
6
|
#
|
7
7
|
set :static, true
|
8
8
|
set :public, File.dirname(__FILE__)
|
9
|
-
set :views, File.expand_path('views',
|
9
|
+
set :views, File.expand_path('../views', __FILE__)
|
10
10
|
set :haml, :format => :html5
|
11
11
|
|
12
12
|
# Load the simplified "model".
|
13
13
|
#
|
14
|
-
require File.expand_path 'book',
|
14
|
+
require File.expand_path '../book', __FILE__
|
15
15
|
|
16
16
|
# Sets up a search instance to the server.
|
17
17
|
#
|
@@ -2,7 +2,7 @@ source :gemcutter
|
|
2
2
|
|
3
3
|
# Gems required by Picky.
|
4
4
|
#
|
5
|
-
gem 'picky', '3.0.0.
|
5
|
+
gem 'picky', '3.0.0.pre4' # '~> 3.0'
|
6
6
|
gem 'rake'
|
7
7
|
gem 'rack'
|
8
8
|
gem 'rack-mount'
|
@@ -22,6 +22,6 @@ gem 'mysql' # Project specific.
|
|
22
22
|
gem 'redis' # Project specific.
|
23
23
|
|
24
24
|
group :test do
|
25
|
-
gem 'picky-client', '3.0.0.
|
25
|
+
gem 'picky-client', '3.0.0.pre4'
|
26
26
|
gem 'rspec'
|
27
27
|
end
|
@@ -2,7 +2,7 @@ source :gemcutter
|
|
2
2
|
|
3
3
|
# Gems required by Picky.
|
4
4
|
#
|
5
|
-
gem 'picky', '3.0.0.
|
5
|
+
gem 'picky', '3.0.0.pre4' # '~> 3.0'
|
6
6
|
gem 'rake'
|
7
7
|
gem 'rack'
|
8
8
|
gem 'rack_fast_escape', '2009.06.24' # Optional.
|
@@ -22,6 +22,6 @@ gem 'mysql' # Project specific.
|
|
22
22
|
gem 'redis' # Project specific.
|
23
23
|
|
24
24
|
group :test do
|
25
|
-
gem 'picky-client', '3.0.0.
|
25
|
+
gem 'picky-client', '3.0.0.pre4'
|
26
26
|
gem 'rspec'
|
27
27
|
end
|
@@ -15,6 +15,9 @@ describe Picky::Generators::Selector do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe "generator_for" do
|
18
|
+
it "should not raise if a generator is available" do
|
19
|
+
lambda { @selector.generator_for('all_in_one', 'some_project') }.should_not raise_error
|
20
|
+
end
|
18
21
|
it "should not raise if a generator is available" do
|
19
22
|
lambda { @selector.generator_for('sinatra_client', 'some_project') }.should_not raise_error
|
20
23
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: picky-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 3.0.0.
|
5
|
+
version: 3.0.0.pre4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Florian Hanke
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 3.0.0.
|
35
|
+
version: 3.0.0.pre4
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id002
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - ~>
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 3.0.0.
|
46
|
+
version: 3.0.0.pre4
|
47
47
|
type: :runtime
|
48
48
|
version_requirements: *id003
|
49
49
|
description: Generators for Picky.
|
@@ -55,6 +55,7 @@ extensions: []
|
|
55
55
|
extra_rdoc_files: []
|
56
56
|
|
57
57
|
files:
|
58
|
+
- lib/picky-generators/generators/all_in_one/sinatra.rb
|
58
59
|
- lib/picky-generators/generators/base.rb
|
59
60
|
- lib/picky-generators/generators/client/sinatra.rb
|
60
61
|
- lib/picky-generators/generators/not_found_exception.rb
|
@@ -62,6 +63,23 @@ files:
|
|
62
63
|
- lib/picky-generators/generators/server/classic.rb
|
63
64
|
- lib/picky-generators/generators/server/sinatra.rb
|
64
65
|
- lib/picky-generators.rb
|
66
|
+
- prototypes/all_in_one/sinatra/app.rb
|
67
|
+
- prototypes/all_in_one/sinatra/book.rb
|
68
|
+
- prototypes/all_in_one/sinatra/config.ru
|
69
|
+
- prototypes/all_in_one/sinatra/Gemfile
|
70
|
+
- prototypes/all_in_one/sinatra/images/picky.png
|
71
|
+
- prototypes/all_in_one/sinatra/javascripts/history.adapter.jquery.min.js
|
72
|
+
- prototypes/all_in_one/sinatra/javascripts/history.min.js
|
73
|
+
- prototypes/all_in_one/sinatra/javascripts/jquery-1.5.0.min.js
|
74
|
+
- prototypes/all_in_one/sinatra/javascripts/picky.min.js
|
75
|
+
- prototypes/all_in_one/sinatra/library.csv
|
76
|
+
- prototypes/all_in_one/sinatra/log/README
|
77
|
+
- prototypes/all_in_one/sinatra/logging.rb
|
78
|
+
- prototypes/all_in_one/sinatra/Rakefile
|
79
|
+
- prototypes/all_in_one/sinatra/stylesheets/application.css
|
80
|
+
- prototypes/all_in_one/sinatra/stylesheets/picky.css
|
81
|
+
- prototypes/all_in_one/sinatra/views/configure.haml
|
82
|
+
- prototypes/all_in_one/sinatra/views/search.haml
|
65
83
|
- prototypes/client/sinatra/app.rb
|
66
84
|
- prototypes/client/sinatra/book.rb
|
67
85
|
- prototypes/client/sinatra/config.ru
|