lady_josephine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +32 -0
- data/app/assets/fonts/lady_josephine/icons/icons.eot +0 -0
- data/app/assets/fonts/lady_josephine/icons/icons.svg +215 -0
- data/app/assets/fonts/lady_josephine/icons/icons.ttf +0 -0
- data/app/assets/fonts/lady_josephine/icons/icons.woff +0 -0
- data/app/assets/javascripts/lady_josephine/blocks/facebook.js +25 -0
- data/app/assets/javascripts/lady_josephine/blocks/instagram.js +22 -0
- data/app/assets/javascripts/lady_josephine/blocks/soundcloud.js +24 -0
- data/app/assets/javascripts/lady_josephine/blocks/twitter.js +25 -0
- data/app/assets/javascripts/lady_josephine/blocks/vimeo.js +55 -0
- data/app/assets/javascripts/lady_josephine/blocks/youtube.js +64 -0
- data/app/assets/javascripts/lady_josephine/editor.js +40 -0
- data/app/assets/javascripts/lady_josephine/lady_josephine.js +4 -0
- data/app/assets/javascripts/lady_josephine/lady_josephine_view.js +6 -0
- data/app/assets/stylesheets/lady_josephine/content.sass +33 -0
- data/app/assets/stylesheets/lady_josephine/icons.sass +175 -0
- data/app/assets/stylesheets/lady_josephine/lady_josephine.sass +6 -0
- data/app/assets/stylesheets/lady_josephine/sir_trevor.sass +619 -0
- data/app/assets/stylesheets/lady_josephine/vars.sass +36 -0
- data/app/controllers/lady_josephine/application_controller.rb +4 -0
- data/app/controllers/lady_josephine/editor_controller.rb +40 -0
- data/app/controllers/lady_josephine/images_controller.rb +26 -0
- data/app/helpers/lady_josephine/helper.rb +25 -0
- data/app/helpers/lady_josephine/sir_trevor_helper.rb +172 -0
- data/app/models/lady_josephine/concerns/model.rb +29 -0
- data/app/models/lady_josephine/concerns/pingable.rb +28 -0
- data/app/models/lady_josephine/concerns/server_uuid.rb +24 -0
- data/app/models/lady_josephine/concerns/sir_trevor_images.rb +38 -0
- data/app/models/lady_josephine/image.rb +41 -0
- data/app/uploader/lady_josephine/base_uploader.rb +47 -0
- data/app/uploader/lady_josephine/image_uploader.rb +149 -0
- data/app/views/lady_josephine/blocks/_audio_block.haml +2 -0
- data/app/views/lady_josephine/blocks/_definition_block.haml +4 -0
- data/app/views/lady_josephine/blocks/_divider_block.haml +2 -0
- data/app/views/lady_josephine/blocks/_extended_image_block.haml +63 -0
- data/app/views/lady_josephine/blocks/_extended_quote_block.haml +5 -0
- data/app/views/lady_josephine/blocks/_extended_tweet_block.haml +2 -0
- data/app/views/lady_josephine/blocks/_facebook_post_block.haml +2 -0
- data/app/views/lady_josephine/blocks/_heading_block.haml +2 -0
- data/app/views/lady_josephine/blocks/_html_block.haml +1 -0
- data/app/views/lady_josephine/blocks/_instagram_block.haml +2 -0
- data/app/views/lady_josephine/blocks/_list_block.haml +3 -0
- data/app/views/lady_josephine/blocks/_quote_block.haml +5 -0
- data/app/views/lady_josephine/blocks/_text_block.html.haml +2 -0
- data/app/views/lady_josephine/blocks/_video_block.haml +9 -0
- data/config/routes.rb +9 -0
- data/db/migrate/20160222151500_lady_josephine_image.rb +18 -0
- data/lib/generators/lady_josephine_migration/USAGE +9 -0
- data/lib/generators/lady_josephine_migration/lady_josephine_migration_generator.rb +17 -0
- data/lib/generators/lady_josephine_migration/templates/migration.rb +9 -0
- data/lib/lady_josephine.rb +18 -0
- data/lib/lady_josephine/engine.rb +18 -0
- data/lib/lady_josephine/redcarpet/custom_markdown_formatter.rb +63 -0
- data/lib/lady_josephine/renderer/sir_trevor_renderer.rb +16 -0
- data/lib/lady_josephine/version.rb +3 -0
- data/lib/lady_josephine/whitelist.rb +26 -0
- data/lib/tasks/lady_josephine_tasks.rake +4 -0
- data/spec/controllers/lady_josephine/editor_controller_spec.rb +58 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +16 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/bla +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/spec_helper.rb +17 -0
- data/vendor/assets/components/Eventable/README.md +12 -0
- data/vendor/assets/components/Eventable/bower.json +10 -0
- data/vendor/assets/components/Eventable/component.json +11 -0
- data/vendor/assets/components/Eventable/eventable.js +207 -0
- data/vendor/assets/components/Eventable/package.json +15 -0
- data/vendor/assets/components/jquery-autosize/bower.json +30 -0
- data/vendor/assets/components/jquery-autosize/demo.html +36 -0
- data/vendor/assets/components/jquery-autosize/jquery.autosize.js +273 -0
- data/vendor/assets/components/jquery-autosize/jquery.autosize.min.js +6 -0
- data/vendor/assets/components/jquery-autosize/package.json +32 -0
- data/vendor/assets/components/jquery-autosize/readme.md +216 -0
- data/vendor/assets/components/jquery/AUTHORS.txt +163 -0
- data/vendor/assets/components/jquery/CONTRIBUTING.md +216 -0
- data/vendor/assets/components/jquery/Gruntfile.js +496 -0
- data/vendor/assets/components/jquery/MIT-LICENSE.txt +21 -0
- data/vendor/assets/components/jquery/README.md +415 -0
- data/vendor/assets/components/jquery/build/release-notes.js +59 -0
- data/vendor/assets/components/jquery/build/release.js +246 -0
- data/vendor/assets/components/jquery/component.json +13 -0
- data/vendor/assets/components/jquery/composer.json +35 -0
- data/vendor/assets/components/jquery/jquery-migrate.js +496 -0
- data/vendor/assets/components/jquery/jquery-migrate.min.js +3 -0
- data/vendor/assets/components/jquery/jquery.js +9597 -0
- data/vendor/assets/components/jquery/jquery.min.js +5 -0
- data/vendor/assets/components/jquery/jquery.min.map +1 -0
- data/vendor/assets/components/jquery/package.json +39 -0
- data/vendor/assets/components/jquery/speed/benchmark.js +15 -0
- data/vendor/assets/components/jquery/speed/benchmarker.css +65 -0
- data/vendor/assets/components/jquery/speed/benchmarker.js +181 -0
- data/vendor/assets/components/jquery/speed/closest.html +39 -0
- data/vendor/assets/components/jquery/speed/css.html +82 -0
- data/vendor/assets/components/jquery/speed/event.html +58 -0
- data/vendor/assets/components/jquery/speed/filter.html +183 -0
- data/vendor/assets/components/jquery/speed/find.html +179 -0
- data/vendor/assets/components/jquery/speed/index.html +72 -0
- data/vendor/assets/components/jquery/speed/jquery-basis.js +6238 -0
- data/vendor/assets/components/jquery/speed/slice.vs.concat.html +47 -0
- data/vendor/assets/components/jquery/src/ajax.js +851 -0
- data/vendor/assets/components/jquery/src/ajax/jsonp.js +80 -0
- data/vendor/assets/components/jquery/src/ajax/script.js +86 -0
- data/vendor/assets/components/jquery/src/ajax/xhr.js +207 -0
- data/vendor/assets/components/jquery/src/attributes.js +661 -0
- data/vendor/assets/components/jquery/src/callbacks.js +196 -0
- data/vendor/assets/components/jquery/src/core.js +949 -0
- data/vendor/assets/components/jquery/src/css.js +679 -0
- data/vendor/assets/components/jquery/src/data.js +340 -0
- data/vendor/assets/components/jquery/src/deferred.js +141 -0
- data/vendor/assets/components/jquery/src/deprecated.js +4 -0
- data/vendor/assets/components/jquery/src/dimensions.js +41 -0
- data/vendor/assets/components/jquery/src/effects.js +730 -0
- data/vendor/assets/components/jquery/src/event-alias.js +15 -0
- data/vendor/assets/components/jquery/src/event.js +991 -0
- data/vendor/assets/components/jquery/src/exports.js +18 -0
- data/vendor/assets/components/jquery/src/intro.js +20 -0
- data/vendor/assets/components/jquery/src/manipulation.js +796 -0
- data/vendor/assets/components/jquery/src/offset.js +169 -0
- data/vendor/assets/components/jquery/src/outro.js +2 -0
- data/vendor/assets/components/jquery/src/queue.js +147 -0
- data/vendor/assets/components/jquery/src/serialize.js +99 -0
- data/vendor/assets/components/jquery/src/sizzle-jquery.js +9 -0
- data/vendor/assets/components/jquery/src/support.js +241 -0
- data/vendor/assets/components/jquery/src/traversing.js +275 -0
- data/vendor/assets/components/jquery/test/csp.php +16 -0
- data/vendor/assets/components/jquery/test/data/1x1.jpg +0 -0
- data/vendor/assets/components/jquery/test/data/ajax/unreleasedXHR.html +25 -0
- data/vendor/assets/components/jquery/test/data/atom+xml.php +4 -0
- data/vendor/assets/components/jquery/test/data/badcall.js +1 -0
- data/vendor/assets/components/jquery/test/data/badjson.js +1 -0
- data/vendor/assets/components/jquery/test/data/cleanScript.html +10 -0
- data/vendor/assets/components/jquery/test/data/core/cc_on.html +22 -0
- data/vendor/assets/components/jquery/test/data/dashboard.xml +11 -0
- data/vendor/assets/components/jquery/test/data/dimensions/documentLarge.html +17 -0
- data/vendor/assets/components/jquery/test/data/dimensions/documentSmall.html +21 -0
- data/vendor/assets/components/jquery/test/data/echoData.php +1 -0
- data/vendor/assets/components/jquery/test/data/echoQuery.php +1 -0
- data/vendor/assets/components/jquery/test/data/errorWithText.php +5 -0
- data/vendor/assets/components/jquery/test/data/etag.php +21 -0
- data/vendor/assets/components/jquery/test/data/evalScript.php +1 -0
- data/vendor/assets/components/jquery/test/data/event/longLoadScript.php +4 -0
- data/vendor/assets/components/jquery/test/data/event/promiseReady.html +17 -0
- data/vendor/assets/components/jquery/test/data/event/syncReady.html +23 -0
- data/vendor/assets/components/jquery/test/data/headers.php +18 -0
- data/vendor/assets/components/jquery/test/data/if_modified_since.php +20 -0
- data/vendor/assets/components/jquery/test/data/iframe.html +8 -0
- data/vendor/assets/components/jquery/test/data/jquery-1.8.2.ajax_xhr.min.js +2 -0
- data/vendor/assets/components/jquery/test/data/json.php +13 -0
- data/vendor/assets/components/jquery/test/data/json_obj.js +1 -0
- data/vendor/assets/components/jquery/test/data/jsonp.php +14 -0
- data/vendor/assets/components/jquery/test/data/manipulation/iframe-denied.html +36 -0
- data/vendor/assets/components/jquery/test/data/name.html +1 -0
- data/vendor/assets/components/jquery/test/data/name.php +24 -0
- data/vendor/assets/components/jquery/test/data/nocontent.php +5 -0
- data/vendor/assets/components/jquery/test/data/offset/absolute.html +41 -0
- data/vendor/assets/components/jquery/test/data/offset/body.html +26 -0
- data/vendor/assets/components/jquery/test/data/offset/fixed.html +34 -0
- data/vendor/assets/components/jquery/test/data/offset/relative.html +31 -0
- data/vendor/assets/components/jquery/test/data/offset/scroll.html +39 -0
- data/vendor/assets/components/jquery/test/data/offset/static.html +31 -0
- data/vendor/assets/components/jquery/test/data/offset/table.html +43 -0
- data/vendor/assets/components/jquery/test/data/params_html.php +12 -0
- data/vendor/assets/components/jquery/test/data/readywaitasset.js +1 -0
- data/vendor/assets/components/jquery/test/data/readywaitloader.js +25 -0
- data/vendor/assets/components/jquery/test/data/script.php +11 -0
- data/vendor/assets/components/jquery/test/data/selector/html5_selector.html +114 -0
- data/vendor/assets/components/jquery/test/data/selector/sizzle_cache.html +21 -0
- data/vendor/assets/components/jquery/test/data/statusText.php +5 -0
- data/vendor/assets/components/jquery/test/data/support/bodyBackground.html +28 -0
- data/vendor/assets/components/jquery/test/data/support/shrinkWrapBlocks.html +23 -0
- data/vendor/assets/components/jquery/test/data/support/testElementCrash.html +17 -0
- data/vendor/assets/components/jquery/test/data/test.html +7 -0
- data/vendor/assets/components/jquery/test/data/test.js +3 -0
- data/vendor/assets/components/jquery/test/data/test.php +7 -0
- data/vendor/assets/components/jquery/test/data/test2.html +5 -0
- data/vendor/assets/components/jquery/test/data/test3.html +3 -0
- data/vendor/assets/components/jquery/test/data/testinit.js +269 -0
- data/vendor/assets/components/jquery/test/data/testrunner.js +368 -0
- data/vendor/assets/components/jquery/test/data/testsuite.css +155 -0
- data/vendor/assets/components/jquery/test/data/text.php +12 -0
- data/vendor/assets/components/jquery/test/data/ua.txt +272 -0
- data/vendor/assets/components/jquery/test/data/with_fries.xml +25 -0
- data/vendor/assets/components/jquery/test/data/with_fries_over_jsonp.php +7 -0
- data/vendor/assets/components/jquery/test/delegatetest.html +228 -0
- data/vendor/assets/components/jquery/test/hovertest.html +158 -0
- data/vendor/assets/components/jquery/test/index.html +330 -0
- data/vendor/assets/components/jquery/test/localfile.html +75 -0
- data/vendor/assets/components/jquery/test/networkerror.html +84 -0
- data/vendor/assets/components/jquery/test/polluted.php +110 -0
- data/vendor/assets/components/jquery/test/readywait.html +70 -0
- data/vendor/assets/components/jquery/test/unit/ajax.js +1971 -0
- data/vendor/assets/components/jquery/test/unit/attributes.js +1332 -0
- data/vendor/assets/components/jquery/test/unit/callbacks.js +326 -0
- data/vendor/assets/components/jquery/test/unit/core.js +1332 -0
- data/vendor/assets/components/jquery/test/unit/css.js +1036 -0
- data/vendor/assets/components/jquery/test/unit/data.js +636 -0
- data/vendor/assets/components/jquery/test/unit/deferred.js +440 -0
- data/vendor/assets/components/jquery/test/unit/deprecated.js +1 -0
- data/vendor/assets/components/jquery/test/unit/dimensions.js +461 -0
- data/vendor/assets/components/jquery/test/unit/effects.js +2050 -0
- data/vendor/assets/components/jquery/test/unit/event.js +2690 -0
- data/vendor/assets/components/jquery/test/unit/exports.js +7 -0
- data/vendor/assets/components/jquery/test/unit/manipulation.js +2242 -0
- data/vendor/assets/components/jquery/test/unit/offset.js +549 -0
- data/vendor/assets/components/jquery/test/unit/queue.js +316 -0
- data/vendor/assets/components/jquery/test/unit/selector.js +185 -0
- data/vendor/assets/components/jquery/test/unit/serialize.js +146 -0
- data/vendor/assets/components/jquery/test/unit/support.js +384 -0
- data/vendor/assets/components/jquery/test/unit/traversing.js +667 -0
- data/vendor/assets/components/jquery/test/xhtml.php +5 -0
- data/vendor/assets/components/sir-trevor-js/CHANGELOG.md +44 -0
- data/vendor/assets/components/sir-trevor-js/Gemfile +3 -0
- data/vendor/assets/components/sir-trevor-js/Gemfile.lock +10 -0
- data/vendor/assets/components/sir-trevor-js/Gruntfile.js +109 -0
- data/vendor/assets/components/sir-trevor-js/MIT-LICENCE +20 -0
- data/vendor/assets/components/sir-trevor-js/Readme.md +84 -0
- data/vendor/assets/components/sir-trevor-js/bower.json +21 -0
- data/vendor/assets/components/sir-trevor-js/component.json +42 -0
- data/vendor/assets/components/sir-trevor-js/contributing.md +74 -0
- data/vendor/assets/components/sir-trevor-js/examples-component/component.json +14 -0
- data/vendor/assets/components/sir-trevor-js/examples-component/index.html +33 -0
- data/vendor/assets/components/sir-trevor-js/examples-component/index.js +29 -0
- data/vendor/assets/components/sir-trevor-js/examples-component/javascript/example_block.js +203 -0
- data/vendor/assets/components/sir-trevor-js/examples-component/javascript/limit_chars.js +46 -0
- data/vendor/assets/components/sir-trevor-js/examples-component/sir-trevor.gif +0 -0
- data/vendor/assets/components/sir-trevor-js/locales/cn.js +51 -0
- data/vendor/assets/components/sir-trevor-js/locales/de.js +51 -0
- data/vendor/assets/components/sir-trevor-js/locales/es.js +51 -0
- data/vendor/assets/components/sir-trevor-js/locales/fi.js +51 -0
- data/vendor/assets/components/sir-trevor-js/locales/fr.js +51 -0
- data/vendor/assets/components/sir-trevor-js/locales/pt.js +52 -0
- data/vendor/assets/components/sir-trevor-js/package.json +23 -0
- data/vendor/assets/components/sir-trevor-js/sir-trevor-icons.css +6 -0
- data/vendor/assets/components/sir-trevor-js/sir-trevor.css +393 -0
- data/vendor/assets/components/sir-trevor-js/sir-trevor.css.map +7 -0
- data/vendor/assets/components/sir-trevor-js/sir-trevor.js +5481 -0
- data/vendor/assets/components/sir-trevor-js/sir-trevor.min.js +13 -0
- data/vendor/assets/components/underscore/CNAME +1 -0
- data/vendor/assets/components/underscore/CONTRIBUTING.md +9 -0
- data/vendor/assets/components/underscore/LICENSE +22 -0
- data/vendor/assets/components/underscore/README.md +19 -0
- data/vendor/assets/components/underscore/Rakefile +10 -0
- data/vendor/assets/components/underscore/docs/docco.css +192 -0
- data/vendor/assets/components/underscore/docs/favicon.ico +0 -0
- data/vendor/assets/components/underscore/docs/images/background.png +0 -0
- data/vendor/assets/components/underscore/docs/images/underscore.png +0 -0
- data/vendor/assets/components/underscore/docs/underscore.html +823 -0
- data/vendor/assets/components/underscore/favicon.ico +0 -0
- data/vendor/assets/components/underscore/index.html +2467 -0
- data/vendor/assets/components/underscore/index.js +1 -0
- data/vendor/assets/components/underscore/package.json +16 -0
- data/vendor/assets/components/underscore/test/arrays.js +200 -0
- data/vendor/assets/components/underscore/test/chaining.js +59 -0
- data/vendor/assets/components/underscore/test/collections.js +453 -0
- data/vendor/assets/components/underscore/test/functions.js +265 -0
- data/vendor/assets/components/underscore/test/index.html +44 -0
- data/vendor/assets/components/underscore/test/objects.js +570 -0
- data/vendor/assets/components/underscore/test/speed.js +75 -0
- data/vendor/assets/components/underscore/test/utility.js +266 -0
- data/vendor/assets/components/underscore/test/vendor/jquery.js +9404 -0
- data/vendor/assets/components/underscore/test/vendor/jslitmus.js +670 -0
- data/vendor/assets/components/underscore/test/vendor/qunit.css +235 -0
- data/vendor/assets/components/underscore/test/vendor/qunit.js +1977 -0
- data/vendor/assets/components/underscore/test/vendor/runner.js +98 -0
- data/vendor/assets/components/underscore/underscore-min.js +1 -0
- data/vendor/assets/components/underscore/underscore.js +1226 -0
- metadata +473 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
module LadyJosephine
|
2
|
+
class Whitelist
|
3
|
+
include Singleton
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@whitelist_classes = []
|
7
|
+
end
|
8
|
+
|
9
|
+
def whitelist(class_to_add)
|
10
|
+
if class_to_add.instance_of? String
|
11
|
+
@whitelist_classes << class_to_add
|
12
|
+
else
|
13
|
+
@whitelist_classes << class_to_add.to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def is_whitelisted?(class_to_check)
|
18
|
+
if class_to_check.instance_of? String
|
19
|
+
@whitelist_classes.include? class_to_check.classify
|
20
|
+
else
|
21
|
+
@whitelist_classes.include? class_to_check.to_s
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
|
2
|
+
# #version
|
3
|
+
|
4
|
+
# describe '#ping' do
|
5
|
+
# before do
|
6
|
+
# sign_in current_user
|
7
|
+
# end
|
8
|
+
# let(:current_user) { author }
|
9
|
+
|
10
|
+
# after do
|
11
|
+
# Timecop.return
|
12
|
+
# end
|
13
|
+
|
14
|
+
# it 'returns 404 if article was not found' do
|
15
|
+
# post :ping, id: "not-found"
|
16
|
+
# expect(response.status).to eql 404
|
17
|
+
# end
|
18
|
+
|
19
|
+
# it 'updates the user if the time was okay' do
|
20
|
+
# post :ping, id: article.server_uuid
|
21
|
+
# json = JSON.parse(response.body)
|
22
|
+
# expect(response.status).to eql 200
|
23
|
+
# expect(json["ping"]["state"]).to eq "OK"
|
24
|
+
# expect(json["ping"]["user_id"]).to eq current_user.id
|
25
|
+
# expect(json["ping"]["user_name"]).to eq current_user.name
|
26
|
+
# end
|
27
|
+
|
28
|
+
# it 'updates the user if it was forced' do
|
29
|
+
# Timecop.freeze(Time.local(2014, 10, 10, 1, 0, 15))
|
30
|
+
# article.ping_date = Time.local(2014, 10, 10, 1, 0, 0)
|
31
|
+
# article.ping_user = admin
|
32
|
+
# article.save
|
33
|
+
|
34
|
+
# post :ping, id: article.server_uuid, update: "force"
|
35
|
+
|
36
|
+
# json = JSON.parse(response.body)
|
37
|
+
# expect(response.status).to eql 200
|
38
|
+
# expect(json["ping"]["state"]).to eq "OK"
|
39
|
+
# expect(json["ping"]["user_id"]).to eq current_user.id
|
40
|
+
# expect(json["ping"]["user_name"]).to eq current_user.name
|
41
|
+
# end
|
42
|
+
|
43
|
+
# it 'does not update the user if another one edits the content' do
|
44
|
+
# Timecop.freeze(Time.local(2014, 10, 10, 1, 0, 15))
|
45
|
+
# article.ping_date = Time.local(2014, 10, 10, 1, 0, 0)
|
46
|
+
# article.ping_user = admin
|
47
|
+
# article.save
|
48
|
+
|
49
|
+
# post :ping, id: article.server_uuid
|
50
|
+
|
51
|
+
# json = JSON.parse(response.body)
|
52
|
+
# expect(response.status).to eql 200
|
53
|
+
# expect(json["ping"]["state"]).to eq "CONFLICT"
|
54
|
+
# expect(json["ping"]["user_id"]).to eq admin.id
|
55
|
+
# expect(json["ping"]["user_name"]).to eq admin.name
|
56
|
+
# end
|
57
|
+
|
58
|
+
# end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
require "lady_josephine"
|
7
|
+
|
8
|
+
module Dummy
|
9
|
+
class Application < Rails::Application
|
10
|
+
# Settings in config/environments/* take precedence over those specified here.
|
11
|
+
# Application configuration should go into files in config/initializers
|
12
|
+
# -- all .rb files in that directory are automatically loaded.
|
13
|
+
|
14
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
15
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
16
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
17
|
+
|
18
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
19
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
20
|
+
# config.i18n.default_locale = :de
|
21
|
+
|
22
|
+
# Do not swallow errors in after_commit/after_rollback callbacks.
|
23
|
+
config.active_record.raise_in_transactional_callbacks = true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
31
|
+
# yet still be able to expire them through the digest params.
|
32
|
+
config.assets.digest = true
|
33
|
+
|
34
|
+
# Adds additional error checking when serving assets at runtime.
|
35
|
+
# Checks for improperly declared sprockets dependencies.
|
36
|
+
# Raises helpful error messages.
|
37
|
+
config.assets.raise_runtime_errors = true
|
38
|
+
|
39
|
+
# Raises error for missing translations
|
40
|
+
# config.action_view.raise_on_missing_translations = true
|
41
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
21
|
+
# config.action_dispatch.rack_cache = true
|
22
|
+
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
26
|
+
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
30
|
+
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
|
+
config.assets.compile = false
|
33
|
+
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
36
|
+
config.assets.digest = true
|
37
|
+
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
39
|
+
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
43
|
+
|
44
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
45
|
+
# config.force_ssl = true
|
46
|
+
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
50
|
+
|
51
|
+
# Prepend all log lines with the following tags.
|
52
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
53
|
+
|
54
|
+
# Use a different logger for distributed setups.
|
55
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
56
|
+
|
57
|
+
# Use a different cache store in production.
|
58
|
+
# config.cache_store = :mem_cache_store
|
59
|
+
|
60
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
62
|
+
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
65
|
+
# config.action_mailer.raise_delivery_errors = false
|
66
|
+
|
67
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
69
|
+
config.i18n.fallbacks = true
|
70
|
+
|
71
|
+
# Send deprecation notices to registered listeners.
|
72
|
+
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
|
77
|
+
# Do not dump schema after migrations.
|
78
|
+
config.active_record.dump_schema_after_migration = false
|
79
|
+
end
|