copycat 0.0.1 → 0.0.2

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.
Files changed (70) hide show
  1. data/MIT-LICENSE +1 -1
  2. data/README.md +53 -0
  3. data/Rakefile +3 -13
  4. data/app/assets/stylesheets/copycat/copycat.css +44 -0
  5. data/app/controllers/copycat_translations_controller.rb +45 -0
  6. data/app/models/copycat_translation.rb +27 -0
  7. data/app/views/copycat_translations/edit.html.erb +7 -0
  8. data/app/views/copycat_translations/index.html.erb +26 -0
  9. data/app/views/copycat_translations/readme.html.erb +41 -0
  10. data/app/views/copycat_translations/upload.html.erb +18 -0
  11. data/config/routes.rb +7 -0
  12. data/db/migrate/20120313191745_create_copycat_translations.rb +13 -0
  13. data/lib/copycat/engine.rb +4 -0
  14. data/lib/copycat/version.rb +1 -1
  15. data/lib/copycat.rb +91 -0
  16. data/{test → spec}/dummy/Rakefile +0 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  18. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  19. data/spec/dummy/app/assets/stylesheets/copycat.css +44 -0
  20. data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
  21. data/spec/dummy/app/controllers/site_controller.rb +5 -0
  22. data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +12 -0
  24. data/spec/dummy/app/views/site/index.html.erb +3 -0
  25. data/{test → spec}/dummy/config/application.rb +0 -11
  26. data/{test → spec}/dummy/config/boot.rb +0 -0
  27. data/{test → spec}/dummy/config/database.yml +0 -0
  28. data/{test → spec}/dummy/config/environment.rb +0 -0
  29. data/{test → spec}/dummy/config/environments/development.rb +1 -8
  30. data/{test → spec}/dummy/config/environments/production.rb +1 -8
  31. data/{test → spec}/dummy/config/environments/test.rb +6 -4
  32. data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
  33. data/{test → spec}/dummy/config/initializers/inflections.rb +0 -5
  34. data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
  35. data/{test → spec}/dummy/config/initializers/secret_token.rb +1 -1
  36. data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
  37. data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +0 -0
  38. data/{test → spec}/dummy/config/locales/en.yml +3 -1
  39. data/spec/dummy/config/routes.rb +3 -0
  40. data/{test → spec}/dummy/config.ru +0 -0
  41. data/spec/dummy/db/development.sqlite3 +0 -0
  42. data/spec/dummy/db/migrate/20120313192639_create_copycat_translations.copycat_engine.rb +14 -0
  43. data/spec/dummy/db/schema.rb +23 -0
  44. data/spec/dummy/db/test.sqlite3 +0 -0
  45. data/spec/dummy/log/development.log +113 -0
  46. data/spec/dummy/log/test.log +5715 -0
  47. data/{test → spec}/dummy/public/404.html +0 -0
  48. data/{test → spec}/dummy/public/422.html +0 -0
  49. data/{test → spec}/dummy/public/500.html +1 -0
  50. data/{test → spec}/dummy/public/favicon.ico +0 -0
  51. data/{test → spec}/dummy/script/rails +0 -0
  52. data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  53. data/spec/dummy/tmp/cache/assets/D1A/DB0/sprockets%2F26d700197b8d25f954d56d8f31f2c8bc +0 -0
  54. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  55. data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  56. data/spec/dummy/tmp/cache/assets/DDD/780/sprockets%2Fe7880b84c3ecb507fabc99b9ef6b70e3 +0 -0
  57. data/spec/factories/copycat_translations.rb +11 -0
  58. data/spec/integration/copycat_spec.rb +83 -0
  59. data/spec/lib/copycat_spec.rb +61 -0
  60. data/spec/models/copycat_translation_spec.rb +64 -0
  61. data/spec/spec_helper.rb +11 -0
  62. metadata +115 -89
  63. data/README.rdoc +0 -3
  64. data/test/copycat_test.rb +0 -7
  65. data/test/dummy/README.rdoc +0 -261
  66. data/test/dummy/app/assets/javascripts/application.js +0 -15
  67. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  68. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  69. data/test/dummy/config/routes.rb +0 -58
  70. data/test/test_helper.rb +0 -10
@@ -0,0 +1,3 @@
1
+ Dummy::Application.routes.draw do
2
+ root :to => "site#index"
3
+ end
File without changes
Binary file
@@ -0,0 +1,14 @@
1
+ # This migration comes from copycat_engine (originally 20120313191745)
2
+ class CreateCopycatTranslations < ActiveRecord::Migration
3
+ def up
4
+ create_table :copycat_translations do |t|
5
+ t.string "key"
6
+ t.text "value"
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def down
12
+ drop_table :copycat_translations
13
+ end
14
+ end
@@ -0,0 +1,23 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20120313192639) do
15
+
16
+ create_table "copycat_translations", :force => true do |t|
17
+ t.string "key"
18
+ t.text "value"
19
+ t.datetime "created_at", :null => false
20
+ t.datetime "updated_at", :null => false
21
+ end
22
+
23
+ end
Binary file
@@ -0,0 +1,113 @@
1
+  (0.1ms) select sqlite_version(*)
2
+  (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
3
+  (0.0ms) PRAGMA index_list("schema_migrations")
4
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
6
+ Migrating to CreateCopycatTranslations (20120313192639)
7
+  (0.0ms) begin transaction
8
+  (0.3ms) CREATE TABLE "copycat_translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
9
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120313192639')
10
+  (1.0ms) commit transaction
11
+  (0.2ms) select sqlite_version(*)
12
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
13
+  (0.0ms) PRAGMA index_list("copycat_translations")
14
+
15
+
16
+ Started GET "/" for 127.0.0.1 at 2012-03-13 15:27:12 -0400
17
+ Processing by SiteController#index as HTML
18
+ CopycatTranslation Load (0.1ms) SELECT "copycat_translations".* FROM "copycat_translations" WHERE (key = 'sample_copy') LIMIT 1
19
+ Rendered site/index.html.erb within layouts/application (34.2ms)
20
+ Compiled application.css (0ms) (pid 64157)
21
+ Completed 500 Internal Server Error in 59ms
22
+
23
+ ActionView::Template::Error (couldn't find file 'jquery'
24
+ (in /vermonster/copycat/spec/dummy/app/assets/javascripts/application.js:7)):
25
+ 3: <head>
26
+ 4: <title>Dummy</title>
27
+ 5: <%= stylesheet_link_tag "application" %>
28
+ 6: <%= javascript_include_tag "application" %>
29
+ 7: <%= csrf_meta_tags %>
30
+ 8: </head>
31
+ 9: <body>
32
+ app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__1893800054813943359_2183503320'
33
+
34
+
35
+ Rendered /Users/sjm/.rvm/gems/ruby-1.9.3-p125@copycat/gems/actionpack-3.2.2/lib/action_dispatch/middleware/templates/rescues/_trace.erb (18.4ms)
36
+ Rendered /Users/sjm/.rvm/gems/ruby-1.9.3-p125@copycat/gems/actionpack-3.2.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
37
+ Rendered /Users/sjm/.rvm/gems/ruby-1.9.3-p125@copycat/gems/actionpack-3.2.2/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (26.1ms)
38
+
39
+
40
+ Started GET "/" for 127.0.0.1 at 2012-03-13 15:28:56 -0400
41
+ Processing by SiteController#index as HTML
42
+ CopycatTranslation Load (0.1ms) SELECT "copycat_translations".* FROM "copycat_translations" WHERE (key = 'sample_copy') LIMIT 1
43
+ Rendered site/index.html.erb within layouts/application (0.6ms)
44
+ Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms)
45
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
46
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
47
+  (0.1ms) select sqlite_version(*)
48
+  (2.5ms) CREATE TABLE "copycat_translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
49
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
50
+  (0.0ms) PRAGMA index_list("schema_migrations")
51
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
52
+  (0.1ms) SELECT version FROM "schema_migrations"
53
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20120313192639')
54
+
55
+
56
+ Started GET "/" for 127.0.0.1 at 2012-03-15 14:53:11 -0400
57
+ Processing by SiteController#index as HTML
58
+ CopycatTranslation Load (0.5ms) SELECT "copycat_translations".* FROM "copycat_translations" WHERE "copycat_translations"."key" = 'site.index.header' LIMIT 1
59
+  (0.1ms) begin transaction
60
+ CopycatTranslation Exists (0.1ms) SELECT 1 FROM "copycat_translations" WHERE "copycat_translations"."key" = 'site.index.header' LIMIT 1
61
+ SQL (1.4ms) INSERT INTO "copycat_translations" ("created_at", "key", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 15 Mar 2012 18:53:11 UTC +00:00], ["key", "site.index.header"], ["updated_at", Thu, 15 Mar 2012 18:53:11 UTC +00:00], ["value", "The Header"]]
62
+  (1.0ms) commit transaction
63
+ CopycatTranslation Load (0.1ms) SELECT "copycat_translations".* FROM "copycat_translations" WHERE "copycat_translations"."key" = 'site.index.intro' LIMIT 1
64
+  (0.0ms) begin transaction
65
+ CopycatTranslation Exists (0.1ms) SELECT 1 FROM "copycat_translations" WHERE "copycat_translations"."key" = 'site.index.intro' LIMIT 1
66
+ SQL (0.3ms) INSERT INTO "copycat_translations" ("created_at", "key", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 15 Mar 2012 18:53:11 UTC +00:00], ["key", "site.index.intro"], ["updated_at", Thu, 15 Mar 2012 18:53:11 UTC +00:00], ["value", "site.index.intro"]]
67
+  (0.7ms) commit transaction
68
+ Rendered site/index.html.erb within layouts/application (89.7ms)
69
+ Compiled copycat.css (0ms) (pid 16641)
70
+ Compiled application.css (6ms) (pid 16641)
71
+ Completed 200 OK in 114ms (Views: 107.7ms | ActiveRecord: 5.7ms)
72
+
73
+
74
+ Started GET "/assets/copycat.css?body=1" for 127.0.0.1 at 2012-03-15 14:53:11 -0400
75
+ Served asset /copycat.css - 200 OK (1ms)
76
+
77
+
78
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-03-15 14:53:11 -0400
79
+ Served asset /application.css - 200 OK (2ms)
80
+
81
+
82
+ Started GET "/copycat_translations" for 127.0.0.1 at 2012-03-15 14:53:19 -0400
83
+ Processing by CopycatTranslationsController#index as HTML
84
+ CopycatTranslation Load (0.1ms) SELECT "copycat_translations".* FROM "copycat_translations" 
85
+ Rendered /vermonster/copycat/app/views/copycat_translations/index.html.erb within layouts/application (1.5ms)
86
+ Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 0.1ms)
87
+
88
+
89
+ Started GET "/copycat_translations/upload" for 127.0.0.1 at 2012-03-15 14:53:21 -0400
90
+ Processing by CopycatTranslationsController#upload as HTML
91
+ Rendered /vermonster/copycat/app/views/copycat_translations/upload.html.erb within layouts/application (1.6ms)
92
+ Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)
93
+
94
+
95
+ Started POST "/copycat_translations/import_yaml" for 127.0.0.1 at 2012-03-15 14:53:28 -0400
96
+ Processing by CopycatTranslationsController#import_yaml as HTML
97
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"PgZqSZfOjZhvTAu+xHuBH36AZqWxY9zQRY9uEcIbPG4=", "file"=>#<ActionDispatch::Http::UploadedFile:0x00000102c34ff8 @original_filename="favicon.ico", @content_type="image/vnd.microsoft.icon", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"favicon.ico\"\r\nContent-Type: image/vnd.microsoft.icon\r\n", @tempfile=#<File:/var/folders/rn/rnXUYLOZH-mYuzcjL2v8Fk+++TI/-Tmp-/RackMultipart20120315-16641-14z0cds>>, "commit"=>"Upload"}
98
+ Rendered /vermonster/copycat/app/views/copycat_translations/upload.html.erb within layouts/application (0.7ms)
99
+ Completed 400 Bad Request in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)
100
+
101
+
102
+ Started POST "/copycat_translations/import_yaml" for 127.0.0.1 at 2012-03-15 14:54:42 -0400
103
+ Processing by CopycatTranslationsController#import_yaml as HTML
104
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"PgZqSZfOjZhvTAu+xHuBH36AZqWxY9zQRY9uEcIbPG4=", "file"=>#<ActionDispatch::Http::UploadedFile:0x00000102a36f08 @original_filename="favicon.ico", @content_type="image/vnd.microsoft.icon", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"favicon.ico\"\r\nContent-Type: image/vnd.microsoft.icon\r\n", @tempfile=#<File:/var/folders/rn/rnXUYLOZH-mYuzcjL2v8Fk+++TI/-Tmp-/RackMultipart20120315-16641-1qimh8k>>, "commit"=>"Upload"}
105
+ Rendered /vermonster/copycat/app/views/copycat_translations/upload.html.erb within layouts/application (20.7ms)
106
+ Completed 400 Bad Request in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)
107
+
108
+
109
+ Started POST "/copycat_translations/import_yaml" for 127.0.0.1 at 2012-03-15 14:54:56 -0400
110
+ Processing by CopycatTranslationsController#import_yaml as HTML
111
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"PgZqSZfOjZhvTAu+xHuBH36AZqWxY9zQRY9uEcIbPG4=", "file"=>#<ActionDispatch::Http::UploadedFile:0x000001008ea980 @original_filename="TODO.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"TODO.txt\"\r\nContent-Type: text/plain\r\n", @tempfile=#<File:/var/folders/rn/rnXUYLOZH-mYuzcjL2v8Fk+++TI/-Tmp-/RackMultipart20120315-16641-1votv6a>>, "commit"=>"Upload"}
112
+ Rendered /vermonster/copycat/app/views/copycat_translations/upload.html.erb within layouts/application (0.7ms)
113
+ Completed 400 Bad Request in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)