picky-generators 3.0.0.pre5 → 3.0.0
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/lib/picky-generators/generators/selector.rb +3 -2
- data/prototypes/all_in_one/sinatra/Gemfile +2 -6
- data/prototypes/all_in_one/sinatra/app.rb +9 -11
- data/prototypes/all_in_one/sinatra/views/configure.haml +1 -1
- data/prototypes/all_in_one/sinatra/views/search.haml +1 -1
- data/prototypes/client/sinatra/Gemfile +1 -1
- data/prototypes/client/sinatra/app.rb +2 -2
- data/prototypes/client/sinatra/views/configure.haml +1 -1
- data/prototypes/server/classic/Gemfile +2 -2
- data/prototypes/server/sinatra/Gemfile +2 -2
- data/prototypes/server/sinatra/app.rb +1 -1
- metadata +7 -7
@@ -10,12 +10,13 @@ module Picky
|
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
@types = {
|
13
|
-
:sinatra_client => [Client::Sinatra, :sinatra_client_name],
|
14
13
|
:client => [Client::Sinatra, :sinatra_client_name],
|
14
|
+
:server => [Server::Sinatra, :sinatra_server_name],
|
15
|
+
|
16
|
+
:sinatra_client => [Client::Sinatra, :sinatra_client_name],
|
15
17
|
|
16
18
|
:classic_server => [Server::Classic, :unicorn_server_name],
|
17
19
|
:sinatra_server => [Server::Sinatra, :sinatra_server_name],
|
18
|
-
:server => [Server::Sinatra, :sinatra_server_name],
|
19
20
|
|
20
21
|
:all_in_one => [AllInOne::Sinatra, :"directory_name (use e.g. for Heroku)"]
|
21
22
|
}
|
@@ -1,11 +1,8 @@
|
|
1
1
|
source :gemcutter
|
2
2
|
|
3
|
-
# TODO Perhaps require two separate Gemfiles?
|
4
|
-
#
|
5
|
-
|
6
3
|
# Gems required by the Picky client.
|
7
4
|
#
|
8
|
-
gem 'picky-client', '
|
5
|
+
gem 'picky-client', '~> 3.0'
|
9
6
|
gem 'i18n'
|
10
7
|
gem 'activesupport', :require => 'active_support/core_ext'
|
11
8
|
gem 'sinatra'
|
@@ -13,7 +10,7 @@ gem 'haml'
|
|
13
10
|
|
14
11
|
# Gems required by the Picky server.
|
15
12
|
#
|
16
|
-
gem 'picky', '
|
13
|
+
gem 'picky', '~> 3.0'
|
17
14
|
gem 'rake'
|
18
15
|
gem 'rack'
|
19
16
|
gem 'rack_fast_escape', '2009.06.24' # Optional.
|
@@ -29,6 +26,5 @@ gem 'activerecord', '~> 3.0', :require => 'active_record'
|
|
29
26
|
gem 'unicorn'
|
30
27
|
|
31
28
|
group :test do
|
32
|
-
gem 'picky-client', '3.0.0.pre5'
|
33
29
|
gem 'rspec'
|
34
30
|
end
|
@@ -65,14 +65,20 @@ class BookSearch < Sinatra::Application
|
|
65
65
|
haml :'/search'
|
66
66
|
end
|
67
67
|
|
68
|
+
# Configure. The configuration info page.
|
69
|
+
#
|
70
|
+
get '/configure' do
|
71
|
+
haml :'/configure'
|
72
|
+
end
|
73
|
+
|
68
74
|
# Renders the results into the json.
|
69
75
|
#
|
70
|
-
# You get the
|
71
|
-
# populate the result with rendered models.
|
76
|
+
# You get the results from the (local) picky server and then
|
77
|
+
# populate the result hash with rendered models.
|
72
78
|
#
|
73
79
|
get '/search/full' do
|
74
80
|
results = books.search params[:query], params[:ids] || 20, params[:offset] || 0
|
75
|
-
AppLogger.info results
|
81
|
+
AppLogger.info results
|
76
82
|
results = results.to_hash
|
77
83
|
results.extend Picky::Convenience
|
78
84
|
results.populate_with Book do |book|
|
@@ -92,19 +98,11 @@ class BookSearch < Sinatra::Application
|
|
92
98
|
|
93
99
|
# Updates the search count while the user is typing.
|
94
100
|
#
|
95
|
-
# We don't parse/reencode the returned json string using search_unparsed.
|
96
|
-
#
|
97
101
|
get '/search/live' do
|
98
102
|
results = books.search params[:query], params[:ids] || 20, params[:offset] || 0
|
99
103
|
results.to_json
|
100
104
|
end
|
101
105
|
|
102
|
-
# Configure. The configuration info page.
|
103
|
-
#
|
104
|
-
get '/configure' do
|
105
|
-
haml :'/configure'
|
106
|
-
end
|
107
|
-
|
108
106
|
helpers do
|
109
107
|
|
110
108
|
def js path
|
@@ -1,7 +1,7 @@
|
|
1
1
|
!!!
|
2
2
|
%html{ :lang => 'en' }
|
3
3
|
%head
|
4
|
-
%link{:href => "stylesheets/
|
4
|
+
%link{:href => "stylesheets/application.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/
|
5
5
|
%body
|
6
6
|
%img{:src => "images/picky.png"}/
|
7
7
|
%p
|
@@ -12,7 +12,7 @@
|
|
12
12
|
%body
|
13
13
|
%img{:src => "images/picky.png"}/
|
14
14
|
%p
|
15
|
-
%a{:href => "http://
|
15
|
+
%a{:href => "http://florianhanke.com/picky"} To the Picky Homepage
|
16
16
|
\/
|
17
17
|
%a{:href => '/configure' } Configuring this app server
|
18
18
|
%p
|
@@ -27,8 +27,8 @@ end
|
|
27
27
|
|
28
28
|
# Renders the results into the json.
|
29
29
|
#
|
30
|
-
# You get the
|
31
|
-
# populate the result with rendered models.
|
30
|
+
# You get the results from the picky server and then
|
31
|
+
# populate the result hash with rendered models.
|
32
32
|
#
|
33
33
|
get '/search/full' do
|
34
34
|
results = BookSearch.search params[:query], :ids => params[:ids], :offset => params[:offset]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
!!!
|
2
2
|
%html{ :lang => 'en' }
|
3
3
|
%head
|
4
|
-
%link{:href => "stylesheets/
|
4
|
+
%link{:href => "stylesheets/application.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/
|
5
5
|
%body
|
6
6
|
%img{:src => "images/picky.png"}/
|
7
7
|
%p
|
@@ -2,7 +2,7 @@ source :gemcutter
|
|
2
2
|
|
3
3
|
# Gems required by Picky.
|
4
4
|
#
|
5
|
-
gem 'picky', '
|
5
|
+
gem 'picky', '~> 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
|
25
|
+
gem 'picky-client', '~> 3.0'
|
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', '
|
5
|
+
gem 'picky', '~> 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
|
25
|
+
gem 'picky-client', '~> 3.0'
|
26
26
|
gem 'rspec'
|
27
27
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picky-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 3.0.0
|
4
|
+
prerelease:
|
5
|
+
version: 3.0.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Florian Hanke
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-08-
|
13
|
+
date: 2011-08-16 00:00:00 +10:00
|
14
14
|
default_executable: picky-generate
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -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
|
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
|
47
47
|
type: :runtime
|
48
48
|
version_requirements: *id003
|
49
49
|
description: Generators for Picky.
|
@@ -143,9 +143,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
144
|
none: false
|
145
145
|
requirements:
|
146
|
-
- - "
|
146
|
+
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
148
|
+
version: "0"
|
149
149
|
requirements: []
|
150
150
|
|
151
151
|
rubyforge_project: http://rubyforge.org/projects/picky
|