tin_opener 0.0.1

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 (81) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +662 -0
  3. data/README.md +37 -0
  4. data/Rakefile +33 -0
  5. data/app/assets/javascripts/tin_opener/application.js +13 -0
  6. data/app/assets/stylesheets/tin_opener/application.css +15 -0
  7. data/app/controllers/tin_opener/application_controller.rb +4 -0
  8. data/app/controllers/tin_opener/data_sets_controller.rb +51 -0
  9. data/app/controllers/tin_opener/records_controller.rb +62 -0
  10. data/app/helpers/tin_opener/application_helper.rb +4 -0
  11. data/app/models/tin_opener/data_set.rb +39 -0
  12. data/app/models/tin_opener/record.rb +8 -0
  13. data/app/views/layouts/tin_opener/application.html.erb +14 -0
  14. data/app/views/tin_opener/data_sets/_form.html.erb +25 -0
  15. data/app/views/tin_opener/data_sets/edit.html.erb +6 -0
  16. data/app/views/tin_opener/data_sets/index.html.erb +29 -0
  17. data/app/views/tin_opener/data_sets/show.html.erb +19 -0
  18. data/app/views/tin_opener/records/_form.html.erb +24 -0
  19. data/app/views/tin_opener/records/_record.html.erb +8 -0
  20. data/app/views/tin_opener/records/edit.html.erb +6 -0
  21. data/app/views/tin_opener/records/index.html.erb +25 -0
  22. data/app/views/tin_opener/records/new.html.erb +5 -0
  23. data/app/views/tin_opener/records/show.html.erb +11 -0
  24. data/config/routes.rb +7 -0
  25. data/config/spring.rb +1 -0
  26. data/db/migrate/20151024183112_enable_hstore.rb +5 -0
  27. data/db/migrate/20151024183219_create_tin_opener_data_sets.rb +10 -0
  28. data/db/migrate/20151024194928_create_tin_opener_records.rb +10 -0
  29. data/lib/tasks/tin_opener_tasks.rake +4 -0
  30. data/lib/tin_opener/data_file_processor.rb +22 -0
  31. data/lib/tin_opener/engine.rb +21 -0
  32. data/lib/tin_opener/version.rb +3 -0
  33. data/lib/tin_opener.rb +8 -0
  34. data/spec/dummy/README.rdoc +28 -0
  35. data/spec/dummy/Rakefile +6 -0
  36. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  37. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  38. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  39. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  40. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  41. data/spec/dummy/bin/bundle +3 -0
  42. data/spec/dummy/bin/rails +8 -0
  43. data/spec/dummy/bin/rake +8 -0
  44. data/spec/dummy/bin/rspec +7 -0
  45. data/spec/dummy/bin/setup +29 -0
  46. data/spec/dummy/bin/spring +15 -0
  47. data/spec/dummy/config/application.rb +31 -0
  48. data/spec/dummy/config/boot.rb +5 -0
  49. data/spec/dummy/config/database.yml +18 -0
  50. data/spec/dummy/config/environment.rb +5 -0
  51. data/spec/dummy/config/environments/development.rb +41 -0
  52. data/spec/dummy/config/environments/production.rb +79 -0
  53. data/spec/dummy/config/environments/test.rb +42 -0
  54. data/spec/dummy/config/initializers/assets.rb +11 -0
  55. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  56. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  57. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  58. data/spec/dummy/config/initializers/inflections.rb +16 -0
  59. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  60. data/spec/dummy/config/initializers/session_store.rb +3 -0
  61. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  62. data/spec/dummy/config/locales/en.yml +23 -0
  63. data/spec/dummy/config/routes.rb +4 -0
  64. data/spec/dummy/config/secrets.yml +22 -0
  65. data/spec/dummy/config.ru +4 -0
  66. data/spec/dummy/db/schema.rb +34 -0
  67. data/spec/dummy/log/development.log +205 -0
  68. data/spec/dummy/log/test.log +812 -0
  69. data/spec/dummy/public/404.html +67 -0
  70. data/spec/dummy/public/422.html +67 -0
  71. data/spec/dummy/public/500.html +66 -0
  72. data/spec/dummy/public/favicon.ico +0 -0
  73. data/spec/examples.txt +7 -0
  74. data/spec/factories/tin_opener_data_sets.rb +6 -0
  75. data/spec/factories/tin_opener_records.rb +6 -0
  76. data/spec/fixtures/data_sets/bici_disponibilidad.csv +71 -0
  77. data/spec/models/tin_opener/data_set_spec.rb +24 -0
  78. data/spec/models/tin_opener/record_spec.rb +10 -0
  79. data/spec/rails_helper.rb +68 -0
  80. data/spec/spec_helper.rb +93 -0
  81. metadata +324 -0
@@ -0,0 +1,205 @@
1
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to EnableHstore (20151024183112)
6
+  (0.1ms) begin transaction
7
+  (0.0ms) rollback transaction
8
+  (4.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
9
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
10
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
+ Migrating to EnableHstore (20151024183112)
12
+  (11.7ms) BEGIN
13
+ SQL (65.8ms) CREATE EXTENSION IF NOT EXISTS "hstore"
14
+ SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151024183112"]]
15
+  (3.6ms) COMMIT
16
+ Migrating to CreateTinOpenerDataSets (20151024183219)
17
+  (0.4ms) BEGIN
18
+  (32.5ms) CREATE TABLE "tin_opener_data_sets" ("id" serial primary key, "name" character varying, "headers" hstore, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
19
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151024183219"]]
20
+  (0.6ms) COMMIT
21
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
22
+  (3.6ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
23
+ FROM pg_constraint c
24
+ JOIN pg_class t1 ON c.conrelid = t1.oid
25
+ JOIN pg_class t2 ON c.confrelid = t2.oid
26
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
27
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
28
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
29
+ WHERE c.contype = 'f'
30
+ AND t1.relname = 'tin_opener_data_sets'
31
+ AND t3.nspname = ANY (current_schemas(false))
32
+ ORDER BY c.conname
33
+ 
34
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
35
+ Migrating to CreateTinOpenerRecords (20151024194928)
36
+  (0.5ms) BEGIN
37
+  (7.0ms) CREATE TABLE "tin_opener_records" ("id" serial primary key, "row_data" hstore, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
38
+ SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151024194928"]]
39
+  (0.6ms) COMMIT
40
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
41
+  (2.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
42
+ FROM pg_constraint c
43
+ JOIN pg_class t1 ON c.conrelid = t1.oid
44
+ JOIN pg_class t2 ON c.confrelid = t2.oid
45
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
46
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
47
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
48
+ WHERE c.contype = 'f'
49
+ AND t1.relname = 'tin_opener_data_sets'
50
+ AND t3.nspname = ANY (current_schemas(false))
51
+ ORDER BY c.conname
52
+ 
53
+  (2.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
54
+ FROM pg_constraint c
55
+ JOIN pg_class t1 ON c.conrelid = t1.oid
56
+ JOIN pg_class t2 ON c.confrelid = t2.oid
57
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
58
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
59
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
60
+ WHERE c.contype = 'f'
61
+ AND t1.relname = 'tin_opener_records'
62
+ AND t3.nspname = ANY (current_schemas(false))
63
+ ORDER BY c.conname
64
+
65
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
66
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
67
+ Migrating to CreateTinOpenerRecords (20151024194928)
68
+  (0.3ms) BEGIN
69
+  (24.0ms) DROP TABLE "tin_opener_records"
70
+ SQL (0.5ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20151024194928"]]
71
+  (1.8ms) COMMIT
72
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
73
+  (2.6ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
74
+ FROM pg_constraint c
75
+ JOIN pg_class t1 ON c.conrelid = t1.oid
76
+ JOIN pg_class t2 ON c.confrelid = t2.oid
77
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
78
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
79
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
80
+ WHERE c.contype = 'f'
81
+ AND t1.relname = 'tin_opener_data_sets'
82
+ AND t3.nspname = ANY (current_schemas(false))
83
+ ORDER BY c.conname
84
+
85
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
86
+ Migrating to CreateTinOpenerRecords (20151024194928)
87
+  (0.4ms) BEGIN
88
+  (8.1ms) CREATE TABLE "tin_opener_records" ("id" serial primary key, "row_data" hstore, "data_set_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
89
+ SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151024194928"]]
90
+  (1.3ms) COMMIT
91
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
92
+  (2.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
93
+ FROM pg_constraint c
94
+ JOIN pg_class t1 ON c.conrelid = t1.oid
95
+ JOIN pg_class t2 ON c.confrelid = t2.oid
96
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
97
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
98
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
99
+ WHERE c.contype = 'f'
100
+ AND t1.relname = 'tin_opener_data_sets'
101
+ AND t3.nspname = ANY (current_schemas(false))
102
+ ORDER BY c.conname
103
+ 
104
+  (3.6ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
105
+ FROM pg_constraint c
106
+ JOIN pg_class t1 ON c.conrelid = t1.oid
107
+ JOIN pg_class t2 ON c.confrelid = t2.oid
108
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
109
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
110
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
111
+ WHERE c.contype = 'f'
112
+ AND t1.relname = 'tin_opener_records'
113
+ AND t3.nspname = ANY (current_schemas(false))
114
+ ORDER BY c.conname
115
+
116
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
117
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
118
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
119
+ FROM pg_constraint c
120
+ JOIN pg_class t1 ON c.conrelid = t1.oid
121
+ JOIN pg_class t2 ON c.confrelid = t2.oid
122
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
123
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
124
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
125
+ WHERE c.contype = 'f'
126
+ AND t1.relname = 'tin_opener_data_sets'
127
+ AND t3.nspname = ANY (current_schemas(false))
128
+ ORDER BY c.conname
129
+ 
130
+  (2.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
131
+ FROM pg_constraint c
132
+ JOIN pg_class t1 ON c.conrelid = t1.oid
133
+ JOIN pg_class t2 ON c.confrelid = t2.oid
134
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
135
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
136
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
137
+ WHERE c.contype = 'f'
138
+ AND t1.relname = 'tin_opener_records'
139
+ AND t3.nspname = ANY (current_schemas(false))
140
+ ORDER BY c.conname
141
+
142
+ ActiveRecord::SchemaMigration Load (6.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
143
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
144
+  (2.9ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
145
+ FROM pg_constraint c
146
+ JOIN pg_class t1 ON c.conrelid = t1.oid
147
+ JOIN pg_class t2 ON c.confrelid = t2.oid
148
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
149
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
150
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
151
+ WHERE c.contype = 'f'
152
+ AND t1.relname = 'tin_opener_data_sets'
153
+ AND t3.nspname = ANY (current_schemas(false))
154
+ ORDER BY c.conname
155
+ 
156
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
157
+ FROM pg_constraint c
158
+ JOIN pg_class t1 ON c.conrelid = t1.oid
159
+ JOIN pg_class t2 ON c.confrelid = t2.oid
160
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
161
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
162
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
163
+ WHERE c.contype = 'f'
164
+ AND t1.relname = 'tin_opener_records'
165
+ AND t3.nspname = ANY (current_schemas(false))
166
+ ORDER BY c.conname
167
+
168
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
169
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
170
+  (2.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
171
+ FROM pg_constraint c
172
+ JOIN pg_class t1 ON c.conrelid = t1.oid
173
+ JOIN pg_class t2 ON c.confrelid = t2.oid
174
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
175
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
176
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
177
+ WHERE c.contype = 'f'
178
+ AND t1.relname = 'tin_opener_data_sets'
179
+ AND t3.nspname = ANY (current_schemas(false))
180
+ ORDER BY c.conname
181
+ 
182
+  (2.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
183
+ FROM pg_constraint c
184
+ JOIN pg_class t1 ON c.conrelid = t1.oid
185
+ JOIN pg_class t2 ON c.confrelid = t2.oid
186
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
187
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
188
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
189
+ WHERE c.contype = 'f'
190
+ AND t1.relname = 'tin_opener_records'
191
+ AND t3.nspname = ANY (current_schemas(false))
192
+ ORDER BY c.conname
193
+
194
+  (130.6ms) DROP DATABASE IF EXISTS "tin_opener_test"
195
+  (588.9ms) CREATE DATABASE "tin_opener_test" ENCODING = 'unicode'
196
+ SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
197
+ SQL (245.5ms) CREATE EXTENSION IF NOT EXISTS "hstore"
198
+  (10.5ms) CREATE TABLE "tin_opener_data_sets" ("id" serial primary key, "name" character varying, "headers" hstore, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
199
+  (4.1ms) CREATE TABLE "tin_opener_records" ("id" serial primary key, "row_data" hstore, "data_set_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
200
+  (2.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
201
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
202
+  (0.8ms) SELECT version FROM "schema_migrations"
203
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151024194928')
204
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20151024183112')
205
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20151024183219')