site_search 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ class GoogleCustomSearchGenerator < Rails::Generator::Base
2
+
3
+ def manifest # this method is default entrance of generator
4
+ record do |m| #Convenience method for generator subclasses to record a manifest.
5
+ m.template "google_custom_search.yml",File.join("config","google_custom_search.yml")
6
+ m.template "load_site_search_config.rb",File.join("config","initializers","load_site_search_config.rb")
7
+ end
8
+ end
9
+
10
+ end
@@ -0,0 +1,25 @@
1
+ # Put your Google Custom Search API key and any search engines you have set up.
2
+
3
+ development: &defaults
4
+ api_key: "YOUR-API-KEY"
5
+ search_engines:
6
+ my_search_engine:
7
+ cx: "CX-RECORD-FOR-MY-SEARCH-ENGINE"
8
+ #cref: "{optional}-YOUR-SEARCH-ENGINE-URL"
9
+ #lr: "{optional}-LANGUAGE-RESTRICTION"
10
+
11
+ # The following options can be supplied or overridden in the options hash
12
+ #num: "{optional}-NUM-OF-RESULTS-1-10(*default)"
13
+ #safe: "{optional}-high/medium/off(*default)"
14
+ #start: "{optional}start-index-between-1(*default)-101"
15
+ #filter: "{optional}-0(duplicates-off)/1(duplicated-on-*default)"
16
+ #alt: "{optional}-json(*default)/atom"
17
+
18
+ production:
19
+ <<: *defaults
20
+
21
+ test:
22
+ <<: *defaults
23
+
24
+
25
+
@@ -0,0 +1,2 @@
1
+ require 'site_search'
2
+ GOOGLE_SEARCH_CONFIG = YAML.load_file("#{Rails.root}/config/google_custom_search.yml")[Rails.env]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_search
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gareth Allen
@@ -49,6 +49,9 @@ files:
49
49
  - lib/site_search/google_search.rb
50
50
  - lib/site_search/result_item.rb
51
51
  - lib/site_search.rb
52
+ - generators/google_custom_search/google_custom_search_generator.rb
53
+ - generators/google_custom_search/templates/google_custom_search.yml
54
+ - generators/google_custom_search/templates/load_site_search_config.rb
52
55
  - MIT-LICENSE
53
56
  - Rakefile
54
57
  - Gemfile