solarsearch 0.0.6
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/.gitignore +23 -0
- data/.specification +294 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +76 -0
- data/Solarsearch.gemspec +176 -0
- data/VERSION +1 -0
- data/app/controllers/article_controller.rb +30 -0
- data/app/controllers/article_statuses_controller.rb +12 -0
- data/app/controllers/infosources_controller.rb +143 -0
- data/app/controllers/search_keywords_controller.rb +99 -0
- data/app/controllers/user_sessions_controller.rb +48 -0
- data/app/controllers/users_controller.rb +62 -0
- data/app/helpers/article_helper.rb +25 -0
- data/app/helpers/article_statuses_helper.rb +2 -0
- data/app/helpers/infosources_helper.rb +2 -0
- data/app/helpers/layout_helper.rb +22 -0
- data/app/helpers/search_keywords_helper.rb +2 -0
- data/app/helpers/site_helper.rb +2 -0
- data/app/helpers/user_sessions_helper.rb +2 -0
- data/app/helpers/users_helper.rb +2 -0
- data/app/models/article.rb +74 -0
- data/app/models/article_status.rb +20 -0
- data/app/models/infosource.rb +83 -0
- data/app/models/role.rb +2 -0
- data/app/models/roles_users.rb +2 -0
- data/app/models/search_keyword.rb +14 -0
- data/app/models/user.rb +132 -0
- data/app/models/user_mailer.rb +12 -0
- data/app/models/user_session.rb +2 -0
- data/config/locales/hu.yml +111 -0
- data/config/locales/sk.yml +111 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/solarsearch.rb +9 -0
- data/lib/solarsearch/locales.rb +3 -0
- data/lib/solarsearch/routing.rb +31 -0
- data/rails/init.rb +1 -0
- data/solarsearch.gemspec +178 -0
- data/tasks/solarsearch_tasks.rake +4 -0
- data/test/blueprints.rb +34 -0
- data/test/blueprints/articles.rb +37 -0
- data/test/blueprints/infosources.rb +53 -0
- data/test/blueprints/infosources_files/pretty.html +17 -0
- data/test/blueprints/infosources_files/ugly.html +399 -0
- data/test/blueprints/search_keywords.rb +13 -0
- data/test/blueprints/users.rb +17 -0
- data/test/content_scrapper.rb +13 -0
- data/test/database.yml +7 -0
- data/test/functional/article_controller_test.rb +40 -0
- data/test/functional/email_controller_test.rb +9 -0
- data/test/functional/infosources_controller_test.rb +65 -0
- data/test/functional/restricted_logged_exceptions_controller_test.rb +38 -0
- data/test/functional/search_keywords_controller_test.rb +108 -0
- data/test/functional/user_sessions_controller_test.rb +39 -0
- data/test/functional/users_controller_test.rb +109 -0
- data/test/schema.rb +92 -0
- data/test/test_helper.rb +48 -0
- data/test/unit/article_test.rb +56 -0
- data/test/unit/helpers/article_helper_test.rb +20 -0
- data/test/unit/helpers/email_helper_test.rb +4 -0
- data/test/unit/helpers/user_sessions_helper_test.rb +4 -0
- data/test/unit/helpers/users_helper_test.rb +4 -0
- data/test/unit/infosource_test.rb +132 -0
- data/test/unit/role_test.rb +6 -0
- data/test/unit/roles_users_test.rb +6 -0
- data/test/unit/user_mailer_test.rb +24 -0
- data/test/unit/user_test.rb +103 -0
- data/uninstall.rb +1 -0
- metadata +297 -0
@@ -0,0 +1,111 @@
|
|
1
|
+
sk:
|
2
|
+
#controllers
|
3
|
+
access_denied_flash: 'Prístup zamietnutý'
|
4
|
+
login_please_flash: 'Prihláste sa'
|
5
|
+
|
6
|
+
infosource_fetched_flash: 'Informačný zdroj bol obnovený. {{items_fetched}} článkov stiahnutých.'
|
7
|
+
nothing_was_fetched_flash: 'Nebol stiahnutý žiadny článok.'
|
8
|
+
infosource_creation_success_flash: 'Informačný zdroj bol úspešne vytvorený.'
|
9
|
+
infosource_update_success_flash: 'Informačný zdroj bol úspešne zmenený.'
|
10
|
+
|
11
|
+
news_were_posted_flash: 'Boli Vám zaslané najnovšie správy.'
|
12
|
+
no_news_were_posted_flash: 'Nenašli sa pre Vás žiadne nové správy.'
|
13
|
+
keyword_does_not_exist_flash: 'Neexistujúce kľúčové slovo'
|
14
|
+
keyword_creation_success_flash: 'Kľúčové slovo úspešne vytvorené.'
|
15
|
+
keyword_update_denied_flash: 'Zmena klúčového slova zamietnutá'
|
16
|
+
keyword_update_success_flash: 'Kľúčové slovo úspešne zmenené.'
|
17
|
+
keyword_destroy_success_flash: 'Kľúčové slovo úspešne zrušené.'
|
18
|
+
|
19
|
+
login_successful_flash: 'Prihlásenie úspešné.'
|
20
|
+
logout_successful_flash: 'Odhlásenie úspešné.'
|
21
|
+
|
22
|
+
registration_successful_flash: 'Registrácia úspešná.'
|
23
|
+
profil_change_success_flash: 'Profil bol úspešne zmenený.'
|
24
|
+
|
25
|
+
#models
|
26
|
+
article_status_sent_word: 'poslané'
|
27
|
+
article_status_viewed_word: 'zobrazené'
|
28
|
+
|
29
|
+
given_username_is_not_correct_validation_error: 'môže obsahovať len malé písmená, číslice a podčiarknutia "_"'
|
30
|
+
given_email_is_not_correct_validation_error: 'nie je korektná emailová adresa'
|
31
|
+
user_not_set_validation_error: 'Chýba používateľ.'
|
32
|
+
article_not_set_validation_error: 'Chýba článok.'
|
33
|
+
status_not_set_validation_error: 'Chýba status.'
|
34
|
+
status_user_article_not_unique_validation_error: 'Pre trojicu článok, status a používateľ môže existovať len jeden záznam.'
|
35
|
+
|
36
|
+
#views
|
37
|
+
unknown_infosource: 'neznámy zdroj'
|
38
|
+
did_not_find_any_results_for_query: 'Nenašli sa žiadne výsledky na dotaz "{{query}}"'
|
39
|
+
search_summary_articles_from: 'Články od {{articles_from}}'
|
40
|
+
search_summary_articles_to: 'do {{articles_to}}'
|
41
|
+
search_summary_number_of_articles: 'z celkového počtu {{articles_total}}.'
|
42
|
+
pagination_previous_label: 'Predchádzajúce'
|
43
|
+
pagination_next_label: 'Nasledujúce'
|
44
|
+
search_articles_button_label: 'Hľadaj v článkoch'
|
45
|
+
article_search_view_title: 'Vyhladávanie'
|
46
|
+
|
47
|
+
article_statuses_view_title: 'Udalosti'
|
48
|
+
article_status_line: '{{article_status}} dňa {{status_update_date}}:'
|
49
|
+
|
50
|
+
infosources_edit_view_title: 'Zmena informačného zdroja'
|
51
|
+
infosources_sourcename_form_field_label: 'Názov'
|
52
|
+
infosources_url_form_field_label: 'URL na feed'
|
53
|
+
infosources_list_view_title: 'Zoznam informačných zdrojov'
|
54
|
+
infosources_new_view_title: 'Nový informačný zdroj'
|
55
|
+
infosources_show_view_title: 'Zobraz detaily informačného zdroja'
|
56
|
+
infosources_unknown_source_text: 'neznámy zdroj'
|
57
|
+
|
58
|
+
infosources_change_action_label: 'Zmeň'
|
59
|
+
infosources_destroy_action_label: 'Zruš'
|
60
|
+
infosources_view_action_label: 'Zobraz'
|
61
|
+
infosources_back_to_the_list_action_label: 'Späť k zoznamu'
|
62
|
+
infosources_new_action_label: 'Nový informačný zdroj'
|
63
|
+
infosources_create_action_label: 'Vytvor'
|
64
|
+
infosources_fetch_action_label: 'Obnov zdroj'
|
65
|
+
infosources_test_scrapper_for_page_label: 'Vyrež obsah stránky'
|
66
|
+
infosources_empty_web_page_content_text: 'Prázdny obsah'
|
67
|
+
|
68
|
+
search_keywords_submit_action_label: 'Potvrdenie'
|
69
|
+
search_keywords_change_view_title: 'Zmena kľúčového slova'
|
70
|
+
search_keywords_index_view_title: 'Kľúčové slová'
|
71
|
+
search_keywords_show_view_title: 'Klúčové slovo'
|
72
|
+
search_keywords_change_action_label: 'Zmeň'
|
73
|
+
search_keywords_destroy_action_label: 'Zruš'
|
74
|
+
search_keywords_back_to_the_list_action_label: 'Späť k zoznamu'
|
75
|
+
search_keywords_view_action_label: 'Zobraz'
|
76
|
+
search_keywords_new_search_keyword_text: 'Nové kľúčové slovo:'
|
77
|
+
search_keywords_my_search_keywords: 'Moje kľúčové slová (zoznam dotazov použitých pri vyhľdávaní):'
|
78
|
+
search_keywords_new_view_title: 'Nové kľúčové slovo'
|
79
|
+
search_keywords_my_news_view_title: 'Moje správy'
|
80
|
+
search_keywords_send_to_email_action_label: 'Pošli na email'
|
81
|
+
search_keywords_query_text: 'Dotaz:'
|
82
|
+
|
83
|
+
this_page_shows_news_not_older_than_xy_days_text: "Na tejto stránke sú zobrazené správy nie staršie než {{days}} dní."
|
84
|
+
for_a_keyword_only_xy_results_are_listed: 'Pre jedno klúčové slovo je zobrazených najviac {{results}} správ.'
|
85
|
+
news_which_were_viewed_through_the_web_and_were_of_your_interest_are_not_listed: 'Správy, o ktorých Vám bol zaslaný email a ktoré ste zobrazili, nie sú uvedené v zozname.'
|
86
|
+
|
87
|
+
user_sessions_login_view_title: 'Prihlásenie'
|
88
|
+
user_sessions_username_form_field_label: 'Login:'
|
89
|
+
user_sessions_password_form_field_label: 'Heslo:'
|
90
|
+
user_sessions_login_action_label: "Prihlásiť"
|
91
|
+
|
92
|
+
users_username_form_field_label: 'Používateľské meno'
|
93
|
+
users_email_form_field_label: 'Email'
|
94
|
+
users_password_from_field_label: 'Heslo'
|
95
|
+
users_password_confirmation_label: 'Potvrdenie hesla'
|
96
|
+
users_submit_form_action_label: 'Potvrdenie'
|
97
|
+
users_change_profile_view_title: 'Zmena profilu'
|
98
|
+
users_registration_view_title: 'Registrácia'
|
99
|
+
|
100
|
+
root_page_action_label: 'Hlavná stránka'
|
101
|
+
my_profile_action_label: 'Môj účet'
|
102
|
+
agent_action_label: 'Agent'
|
103
|
+
my_news_action_label: 'Moje správy'
|
104
|
+
users_action_label: 'Používatelia'
|
105
|
+
inforsources_list_action_label: 'Informačné zdroje'
|
106
|
+
errors_and_exceptions_action_label: 'Chyby a výnimky'
|
107
|
+
logout_user_action_label: 'Odhlásiť sa ({{username}})'
|
108
|
+
registration_action_label: 'Registrácia'
|
109
|
+
login_action_label: 'Prihlásenie'
|
110
|
+
|
111
|
+
are_you_sure_confirmation: 'Ste si istý?'
|
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Include hook code here
|
data/install.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Install hook code here
|
data/lib/solarsearch.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
%w{ controllers helpers models }.each do |dir|
|
2
|
+
path = File.join(File.dirname(__FILE__), '..', 'app', dir)
|
3
|
+
$LOAD_PATH << path
|
4
|
+
ActiveSupport::Dependencies.load_paths << path
|
5
|
+
ActiveSupport::Dependencies.load_once_paths.delete(path)
|
6
|
+
end
|
7
|
+
|
8
|
+
require 'solarsearch/routing'
|
9
|
+
require 'solarsearch/locales'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module SolarSearch #:nodoc:
|
2
|
+
module Routing #:nodoc:
|
3
|
+
module MapperExtensions
|
4
|
+
def solarsearch_routes
|
5
|
+
@set.draw do |map|
|
6
|
+
map.myevents 'myevents', :controller => 'article_statuses', :action => 'index'
|
7
|
+
|
8
|
+
map.tester 'tester', :controller => 'infosources', :action => 'tester'
|
9
|
+
map.mynews 'mynews', :controller => 'search_keywords', :action => 'newsupdate'
|
10
|
+
map.postnews 'postnews', :controller => 'search_keywords', :action => 'postnews'
|
11
|
+
map.agent 'agent', :controller => 'search_keywords', :action => 'index'
|
12
|
+
map.resources :search_keywords
|
13
|
+
|
14
|
+
map.resources :infosources
|
15
|
+
|
16
|
+
map.register 'register', :controller => 'users', :action => 'new'
|
17
|
+
map.resources :users
|
18
|
+
map.show_user 'users/:user_id', :controller => 'users', :action => 'edit'
|
19
|
+
map.agent_for_user 'users/:user_id/agent', :controller => 'search_keywords', :action => 'index'
|
20
|
+
|
21
|
+
map.logged_exceptions "logged_exceptions/:action/:id", :controller => "restricted_logged_exceptions"
|
22
|
+
map.login 'login', :controller => 'user_sessions', :action => 'new'
|
23
|
+
map.logout 'logout', :controller => 'user_sessions', :action => 'destroy'
|
24
|
+
map.resources :user_sessions
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
ActionController::Routing::RouteSet::Mapper.send :include, SolarSearch::Routing::MapperExtensions
|
data/rails/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'solarsearch'
|
data/solarsearch.gemspec
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{solarsearch}
|
8
|
+
s.version = "0.0.6"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Gyorgy Frivolt"]
|
12
|
+
s.date = %q{2010-02-25}
|
13
|
+
s.description = %q{Have a search motor built on the top of Solr, a highly customizable, scalable and well performing search engine. You are only few steps away from creating your own search motor.}
|
14
|
+
s.email = %q{gyorgy.frivolt@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".gitignore",
|
21
|
+
".specification",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"Solarsearch.gemspec",
|
26
|
+
"VERSION",
|
27
|
+
"app/controllers/article_controller.rb",
|
28
|
+
"app/controllers/article_statuses_controller.rb",
|
29
|
+
"app/controllers/infosources_controller.rb",
|
30
|
+
"app/controllers/search_keywords_controller.rb",
|
31
|
+
"app/controllers/user_sessions_controller.rb",
|
32
|
+
"app/controllers/users_controller.rb",
|
33
|
+
"app/helpers/article_helper.rb",
|
34
|
+
"app/helpers/article_statuses_helper.rb",
|
35
|
+
"app/helpers/infosources_helper.rb",
|
36
|
+
"app/helpers/layout_helper.rb",
|
37
|
+
"app/helpers/search_keywords_helper.rb",
|
38
|
+
"app/helpers/site_helper.rb",
|
39
|
+
"app/helpers/user_sessions_helper.rb",
|
40
|
+
"app/helpers/users_helper.rb",
|
41
|
+
"app/models/article.rb",
|
42
|
+
"app/models/article_status.rb",
|
43
|
+
"app/models/infosource.rb",
|
44
|
+
"app/models/role.rb",
|
45
|
+
"app/models/roles_users.rb",
|
46
|
+
"app/models/search_keyword.rb",
|
47
|
+
"app/models/user.rb",
|
48
|
+
"app/models/user_mailer.rb",
|
49
|
+
"app/models/user_session.rb",
|
50
|
+
"config/locales/hu.yml",
|
51
|
+
"config/locales/sk.yml",
|
52
|
+
"init.rb",
|
53
|
+
"install.rb",
|
54
|
+
"lib/solarsearch.rb",
|
55
|
+
"lib/solarsearch/locales.rb",
|
56
|
+
"lib/solarsearch/routing.rb",
|
57
|
+
"rails/init.rb",
|
58
|
+
"solarsearch.gemspec",
|
59
|
+
"tasks/solarsearch_tasks.rake",
|
60
|
+
"test/blueprints.rb",
|
61
|
+
"test/blueprints/articles.rb",
|
62
|
+
"test/blueprints/infosources.rb",
|
63
|
+
"test/blueprints/infosources_files/pretty.html",
|
64
|
+
"test/blueprints/infosources_files/ugly.html",
|
65
|
+
"test/blueprints/search_keywords.rb",
|
66
|
+
"test/blueprints/users.rb",
|
67
|
+
"test/content_scrapper.rb",
|
68
|
+
"test/database.yml",
|
69
|
+
"test/functional/article_controller_test.rb",
|
70
|
+
"test/functional/email_controller_test.rb",
|
71
|
+
"test/functional/infosources_controller_test.rb",
|
72
|
+
"test/functional/restricted_logged_exceptions_controller_test.rb",
|
73
|
+
"test/functional/search_keywords_controller_test.rb",
|
74
|
+
"test/functional/user_sessions_controller_test.rb",
|
75
|
+
"test/functional/users_controller_test.rb",
|
76
|
+
"test/schema.rb",
|
77
|
+
"test/test_helper.rb",
|
78
|
+
"test/unit/article_test.rb",
|
79
|
+
"test/unit/helpers/article_helper_test.rb",
|
80
|
+
"test/unit/helpers/email_helper_test.rb",
|
81
|
+
"test/unit/helpers/user_sessions_helper_test.rb",
|
82
|
+
"test/unit/helpers/users_helper_test.rb",
|
83
|
+
"test/unit/infosource_test.rb",
|
84
|
+
"test/unit/role_test.rb",
|
85
|
+
"test/unit/roles_users_test.rb",
|
86
|
+
"test/unit/user_mailer_test.rb",
|
87
|
+
"test/unit/user_test.rb",
|
88
|
+
"uninstall.rb"
|
89
|
+
]
|
90
|
+
s.homepage = %q{http://github.com/fifigyuri/solarsearch}
|
91
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
92
|
+
s.require_paths = ["lib"]
|
93
|
+
s.rubygems_version = %q{1.3.5}
|
94
|
+
s.summary = %q{Searching made so simple that it is even a fun}
|
95
|
+
s.test_files = [
|
96
|
+
"test/blueprints/users.rb",
|
97
|
+
"test/blueprints/articles.rb",
|
98
|
+
"test/blueprints/search_keywords.rb",
|
99
|
+
"test/blueprints/infosources.rb",
|
100
|
+
"test/schema.rb",
|
101
|
+
"test/functional/search_keywords_controller_test.rb",
|
102
|
+
"test/functional/users_controller_test.rb",
|
103
|
+
"test/functional/infosources_controller_test.rb",
|
104
|
+
"test/functional/article_controller_test.rb",
|
105
|
+
"test/functional/restricted_logged_exceptions_controller_test.rb",
|
106
|
+
"test/functional/user_sessions_controller_test.rb",
|
107
|
+
"test/functional/email_controller_test.rb",
|
108
|
+
"test/test_helper.rb",
|
109
|
+
"test/unit/user_test.rb",
|
110
|
+
"test/unit/roles_users_test.rb",
|
111
|
+
"test/unit/infosource_test.rb",
|
112
|
+
"test/unit/role_test.rb",
|
113
|
+
"test/unit/article_test.rb",
|
114
|
+
"test/unit/user_mailer_test.rb",
|
115
|
+
"test/unit/helpers/article_helper_test.rb",
|
116
|
+
"test/unit/helpers/email_helper_test.rb",
|
117
|
+
"test/unit/helpers/user_sessions_helper_test.rb",
|
118
|
+
"test/unit/helpers/users_helper_test.rb",
|
119
|
+
"test/content_scrapper.rb",
|
120
|
+
"test/blueprints.rb"
|
121
|
+
]
|
122
|
+
|
123
|
+
if s.respond_to? :specification_version then
|
124
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
125
|
+
s.specification_version = 3
|
126
|
+
|
127
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
128
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
129
|
+
s.add_runtime_dependency(%q<content_scrapper>, [">= 0.0.4"])
|
130
|
+
s.add_runtime_dependency(%q<compass>, [">= 0"])
|
131
|
+
s.add_runtime_dependency(%q<haml>, [">= 0"])
|
132
|
+
s.add_runtime_dependency(%q<authlogic>, [">= 0"])
|
133
|
+
s.add_runtime_dependency(%q<will_paginate>, [">= 0"])
|
134
|
+
s.add_runtime_dependency(%q<whenever>, [">= 0"])
|
135
|
+
s.add_runtime_dependency(%q<acl9>, [">= 0"])
|
136
|
+
s.add_runtime_dependency(%q<sunspot>, [">= 0"])
|
137
|
+
s.add_runtime_dependency(%q<sunspot_rails>, [">= 0"])
|
138
|
+
s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
|
139
|
+
s.add_runtime_dependency(%q<sanitize>, [">= 0"])
|
140
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
141
|
+
s.add_runtime_dependency(%q<feedzirra>, [">= 0"])
|
142
|
+
s.add_runtime_dependency(%q<mysql>, [">= 0"])
|
143
|
+
else
|
144
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
145
|
+
s.add_dependency(%q<content_scrapper>, [">= 0.0.4"])
|
146
|
+
s.add_dependency(%q<compass>, [">= 0"])
|
147
|
+
s.add_dependency(%q<haml>, [">= 0"])
|
148
|
+
s.add_dependency(%q<authlogic>, [">= 0"])
|
149
|
+
s.add_dependency(%q<will_paginate>, [">= 0"])
|
150
|
+
s.add_dependency(%q<whenever>, [">= 0"])
|
151
|
+
s.add_dependency(%q<acl9>, [">= 0"])
|
152
|
+
s.add_dependency(%q<sunspot>, [">= 0"])
|
153
|
+
s.add_dependency(%q<sunspot_rails>, [">= 0"])
|
154
|
+
s.add_dependency(%q<RedCloth>, [">= 0"])
|
155
|
+
s.add_dependency(%q<sanitize>, [">= 0"])
|
156
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
157
|
+
s.add_dependency(%q<feedzirra>, [">= 0"])
|
158
|
+
s.add_dependency(%q<mysql>, [">= 0"])
|
159
|
+
end
|
160
|
+
else
|
161
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
162
|
+
s.add_dependency(%q<content_scrapper>, [">= 0.0.4"])
|
163
|
+
s.add_dependency(%q<compass>, [">= 0"])
|
164
|
+
s.add_dependency(%q<haml>, [">= 0"])
|
165
|
+
s.add_dependency(%q<authlogic>, [">= 0"])
|
166
|
+
s.add_dependency(%q<will_paginate>, [">= 0"])
|
167
|
+
s.add_dependency(%q<whenever>, [">= 0"])
|
168
|
+
s.add_dependency(%q<acl9>, [">= 0"])
|
169
|
+
s.add_dependency(%q<sunspot>, [">= 0"])
|
170
|
+
s.add_dependency(%q<sunspot_rails>, [">= 0"])
|
171
|
+
s.add_dependency(%q<RedCloth>, [">= 0"])
|
172
|
+
s.add_dependency(%q<sanitize>, [">= 0"])
|
173
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
174
|
+
s.add_dependency(%q<feedzirra>, [">= 0"])
|
175
|
+
s.add_dependency(%q<mysql>, [">= 0"])
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
data/test/blueprints.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'machinist/active_record'
|
2
|
+
require 'machinist/object'
|
3
|
+
require 'sham'
|
4
|
+
|
5
|
+
class ActiveSupport::TestCase
|
6
|
+
setup { Sham.reset }
|
7
|
+
end
|
8
|
+
|
9
|
+
def random_date_in_past(params={})
|
10
|
+
years_back = params[:year_range] || 5
|
11
|
+
year = (rand * (years_back)).ceil + (Time.now.year - years_back)
|
12
|
+
month = (rand * 12).ceil
|
13
|
+
day = (rand * 31).ceil
|
14
|
+
series = [date = Time.local(year, month, day)]
|
15
|
+
if params[:series]
|
16
|
+
params[:series].each do |some_time_after|
|
17
|
+
series << series.last + (rand * some_time_after).ceil
|
18
|
+
end
|
19
|
+
return series
|
20
|
+
end
|
21
|
+
date
|
22
|
+
end
|
23
|
+
|
24
|
+
Sham.define do
|
25
|
+
url { 'http://' + Faker::Internet.domain_name }
|
26
|
+
incorrect_url { Faker::Internet.domain_name }
|
27
|
+
end
|
28
|
+
|
29
|
+
blueprints_dir = "#{File.dirname(__FILE__)}/blueprints"
|
30
|
+
Dir.entries(blueprints_dir).select \
|
31
|
+
{ |filename| filename =~ /.*\.rb/ }.each do |blueprint_file|
|
32
|
+
require "#{blueprints_dir}/#{blueprint_file}"
|
33
|
+
end
|
34
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
Sham.define do
|
3
|
+
accented_word(:unique => false) { 'ÁáÄäÉéÍíÓóÔôÚúÝýČčĎďĹ弾ŇňŔ੹ŤťŽžDZdzDŽdžÁáÉéÍíÓóÖöŐőÚúÜüŰűŘřĚěŮů' }
|
4
|
+
unaccented_word(:unique => false) { 'AaAaEeIiOoOoUuYyCcDdLlLlNnRrSsTtZzDzdzDzdzAaEeIiOoOoOoUuUuUuRrEeUu' }
|
5
|
+
corrupt_xml_chars(:unique => false) { "\x00\x08\x0B\x0C\x0E\x1F" }
|
6
|
+
end
|
7
|
+
|
8
|
+
Article.blueprint do
|
9
|
+
infosource { Infosource.make }
|
10
|
+
title
|
11
|
+
author
|
12
|
+
summary
|
13
|
+
body { Sham.content }
|
14
|
+
url
|
15
|
+
published_at { Sham.time_in_past }
|
16
|
+
guid
|
17
|
+
end
|
18
|
+
|
19
|
+
Article.blueprint(:accent_in_title) do
|
20
|
+
title { Sham.title + ' ' + Sham.accented_word + ' ' + Sham.title }
|
21
|
+
end
|
22
|
+
|
23
|
+
Article.blueprint(:accent_in_summary) do
|
24
|
+
summary { Sham.summary + ' ' + Sham.accented_word + ' ' + Sham.summary }
|
25
|
+
end
|
26
|
+
|
27
|
+
Article.blueprint(:accent_in_body) do
|
28
|
+
body { Sham.content + ' ' + Sham.accented_word + ' ' + Sham.content }
|
29
|
+
end
|
30
|
+
|
31
|
+
Article.blueprint(:with_corrupt_xml_chars) do
|
32
|
+
title { Sham.corrupt_xml_chars + Sham.title }
|
33
|
+
summary { Sham.corrupt_xml_chars + Sham.summary }
|
34
|
+
body { Sham.corrupt_xml_chars + Sham.content }
|
35
|
+
url { Sham.corrupt_xml_chars + Sham.url }
|
36
|
+
end
|
37
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
|
2
|
+
Sham.define do
|
3
|
+
sourcename { Faker::Name.name }
|
4
|
+
sourcefeed { 'http://' + Faker::Internet.domain_name }
|
5
|
+
|
6
|
+
title { Faker::Lorem.sentence(word_count = 10) }
|
7
|
+
author { Faker::Name.name }
|
8
|
+
summary { Faker::Lorem.sentences(sentence_count = 5).join(' ') }
|
9
|
+
content { Faker::Lorem.sentences(sentence_count = 20).join(' ') }
|
10
|
+
time_in_past { random_date_in_past(:year_range => 3) }
|
11
|
+
guid { Faker::Internet.user_name * 5 }
|
12
|
+
|
13
|
+
pretty_content { File.open("#{File.dirname(__FILE__)}/infosources_files/pretty.html").read }
|
14
|
+
ugly_content { File.open("#{File.dirname(__FILE__)}/infosources_files/ugly.html").read }
|
15
|
+
end
|
16
|
+
|
17
|
+
Infosource.blueprint do
|
18
|
+
sourcename
|
19
|
+
sourcefeed
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'feedzirra/feed_entry_utilities'
|
23
|
+
|
24
|
+
class FeedEntry
|
25
|
+
include Feedzirra::FeedEntryUtilities
|
26
|
+
attr_accessor :title
|
27
|
+
attr_accessor :author
|
28
|
+
attr_accessor :summary
|
29
|
+
attr_accessor :content
|
30
|
+
attr_accessor :url
|
31
|
+
attr_accessor :published
|
32
|
+
attr_accessor :id
|
33
|
+
end
|
34
|
+
|
35
|
+
FeedEntry.blueprint do
|
36
|
+
title
|
37
|
+
author
|
38
|
+
summary
|
39
|
+
content
|
40
|
+
url
|
41
|
+
published { Sham.time_in_past }
|
42
|
+
id { Sham.guid }
|
43
|
+
end
|
44
|
+
|
45
|
+
FeedEntry.blueprint(:known_source) do
|
46
|
+
url { 'http://www.pretty.url/' + Faker::Internet.domain_word }
|
47
|
+
content { nil }
|
48
|
+
end
|
49
|
+
|
50
|
+
FeedEntry.blueprint(:no_content_xpath) do
|
51
|
+
url { 'http://www.skipped.url/' + Faker::Internet.domain_word }
|
52
|
+
end
|
53
|
+
|