bigbroda 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.pryrc +3 -0
  4. data/.rspec +2 -0
  5. data/.rvmrc +1 -0
  6. data/Gemfile +18 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +408 -0
  9. data/Rakefile +12 -0
  10. data/google_bigquery.gemspec +30 -0
  11. data/lib/.DS_Store +0 -0
  12. data/lib/active_record/.DS_Store +0 -0
  13. data/lib/active_record/connection_adapters/bigquery_adapter.rb +949 -0
  14. data/lib/active_record/tasks/bigquery_database_tasks.rb +42 -0
  15. data/lib/generators/.DS_Store +0 -0
  16. data/lib/generators/google_bigquery/.DS_Store +0 -0
  17. data/lib/generators/google_bigquery/install/install_generator.rb +21 -0
  18. data/lib/generators/templates/README +11 -0
  19. data/lib/generators/templates/bigquery.rb.erb +7 -0
  20. data/lib/google_bigquery/auth.rb +27 -0
  21. data/lib/google_bigquery/client.rb +52 -0
  22. data/lib/google_bigquery/config.rb +17 -0
  23. data/lib/google_bigquery/dataset.rb +77 -0
  24. data/lib/google_bigquery/engine.rb +21 -0
  25. data/lib/google_bigquery/jobs.rb +173 -0
  26. data/lib/google_bigquery/project.rb +16 -0
  27. data/lib/google_bigquery/railtie.rb +39 -0
  28. data/lib/google_bigquery/table.rb +63 -0
  29. data/lib/google_bigquery/table_data.rb +23 -0
  30. data/lib/google_bigquery/version.rb +3 -0
  31. data/lib/google_bigquery.rb +27 -0
  32. data/spec/.DS_Store +0 -0
  33. data/spec/dummy/.DS_Store +0 -0
  34. data/spec/dummy/.gitignore +20 -0
  35. data/spec/dummy/README.rdoc +261 -0
  36. data/spec/dummy/Rakefile +7 -0
  37. data/spec/dummy/app/assets/javascripts/application.js +16 -0
  38. data/spec/dummy/app/assets/stylesheets/application.css.scss +13 -0
  39. data/spec/dummy/app/controllers/application_controller.rb +4 -0
  40. data/spec/dummy/app/helpers/application_helper.rb +3 -0
  41. data/spec/dummy/app/mailers/.gitkeep +0 -0
  42. data/spec/dummy/app/models/log_data.rb +3 -0
  43. data/spec/dummy/app/models/post.rb +3 -0
  44. data/spec/dummy/app/models/user.rb +4 -0
  45. data/spec/dummy/app/views/layouts/application.html.haml +32 -0
  46. data/spec/dummy/config/application.rb +23 -0
  47. data/spec/dummy/config/boot.rb +11 -0
  48. data/spec/dummy/config/database.yml +32 -0
  49. data/spec/dummy/config/environment.rb +6 -0
  50. data/spec/dummy/config/environments/development.rb +29 -0
  51. data/spec/dummy/config/environments/production.rb +80 -0
  52. data/spec/dummy/config/environments/test.rb +36 -0
  53. data/spec/dummy/config/initializers/backtrace_silencers.rb +8 -0
  54. data/spec/dummy/config/initializers/bigquery.rb +19 -0
  55. data/spec/dummy/config/initializers/inflections.rb +16 -0
  56. data/spec/dummy/config/initializers/mime_types.rb +6 -0
  57. data/spec/dummy/config/initializers/secret_token.rb +8 -0
  58. data/spec/dummy/config/initializers/session_store.rb +9 -0
  59. data/spec/dummy/config/initializers/wrap_parameters.rb +15 -0
  60. data/spec/dummy/config/locales/devise.en.yml +58 -0
  61. data/spec/dummy/config/locales/en.yml +5 -0
  62. data/spec/dummy/config/locales/simple_form.en.yml +26 -0
  63. data/spec/dummy/config/routes.rb +4 -0
  64. data/spec/dummy/config.ru +4 -0
  65. data/spec/dummy/db/migrate/20140224051640_create_users.rb +11 -0
  66. data/spec/dummy/db/migrate/20140224063709_add_last_name_to_user.rb +5 -0
  67. data/spec/dummy/db/migrate/20140225014314_create_log_data.rb +12 -0
  68. data/spec/dummy/db/migrate/20140227015551_create_posts.rb +9 -0
  69. data/spec/dummy/db/schema.rb +39 -0
  70. data/spec/dummy/db/schema_migrations.json +1 -0
  71. data/spec/dummy/lib/assets/.gitkeep +0 -0
  72. data/spec/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
  73. data/spec/dummy/log/.gitkeep +0 -0
  74. data/spec/dummy/public/404.html +26 -0
  75. data/spec/dummy/public/422.html +26 -0
  76. data/spec/dummy/public/500.html +25 -0
  77. data/spec/dummy/public/favicon.ico +0 -0
  78. data/spec/dummy/script/rails +6 -0
  79. data/spec/dummy/test/fixtures/log_data.yml +9 -0
  80. data/spec/dummy/test/fixtures/posts.yml +11 -0
  81. data/spec/dummy/test/fixtures/users.yml +11 -0
  82. data/spec/dummy/test/models/log_data_test.rb +7 -0
  83. data/spec/dummy/test/models/post_test.rb +7 -0
  84. data/spec/dummy/test/models/user_test.rb +7 -0
  85. data/spec/fixtures/.DS_Store +0 -0
  86. data/spec/fixtures/configs/account_config.yml-example +6 -0
  87. data/spec/fixtures/keys/.DS_Store +0 -0
  88. data/spec/fixtures/keys/example-privatekey-p12 +0 -0
  89. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/.DS_Store +0 -0
  90. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/adapter/simple_quering.yml +324 -0
  91. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/after_each.yml +154 -0
  92. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/authorize_config.yml +367 -0
  93. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/create_each.yml +195 -0
  94. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/migrations/_down/adds_the_email_at_utc_hour_column.yml +575 -0
  95. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/migrations/_up/adds_the_created_at_updated_at_column.yml +644 -0
  96. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/migrations/add_column/adds_published_column.yml +779 -0
  97. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/migrations/associations/users_posts.yml +1464 -0
  98. data/spec/fixtures/vcr_cassettes/ActiveRecord_Adapter/migrations/remove_column/should_raise_error.yml +713 -0
  99. data/spec/fixtures/vcr_cassettes/Dataset/_list.yml +64 -0
  100. data/spec/fixtures/vcr_cassettes/Dataset/authorize_config.yml +367 -0
  101. data/spec/fixtures/vcr_cassettes/Dataset/operations/_get_delete.yml +237 -0
  102. data/spec/fixtures/vcr_cassettes/Dataset/operations/_patch_delete.yml +240 -0
  103. data/spec/fixtures/vcr_cassettes/Dataset/operations/_update_delete.yml +297 -0
  104. data/spec/fixtures/vcr_cassettes/Dataset/operations/create_delete.yml +173 -0
  105. data/spec/fixtures/vcr_cassettes/Project/_list.yml +64 -0
  106. data/spec/fixtures/vcr_cassettes/Project/authorize_config.yml +2166 -0
  107. data/spec/fixtures/vcr_cassettes/Table/authorize_config.yml +367 -0
  108. data/spec/fixtures/vcr_cassettes/Table/operations/creation_edition/_create_delete.yml +404 -0
  109. data/spec/fixtures/vcr_cassettes/Table/operations/creation_edition/_create_update_delete.yml +471 -0
  110. data/spec/fixtures/vcr_cassettes/Table/operations/list.yml +232 -0
  111. data/spec/fixtures/vcr_cassettes/TableData/authorize_config.yml +2166 -0
  112. data/spec/fixtures/vcr_cassettes/TableData/create_each.yml +135 -0
  113. data/spec/fixtures/vcr_cassettes/TableData/delete_each.yml +154 -0
  114. data/spec/fixtures/vcr_cassettes/TableData/insertAll2.yml +189 -0
  115. data/spec/fixtures/vcr_cassettes/auth.yml +2168 -0
  116. data/spec/fixtures/vcr_cassettes/authorize_config.yml +2166 -0
  117. data/spec/fixtures/vcr_cassettes/datasets.yml +119 -0
  118. data/spec/fixtures/vcr_cassettes/delete_each_dataset.yml +48 -0
  119. data/spec/functional/adapter/adapter_spec.rb +213 -0
  120. data/spec/functional/auth_spec.rb +24 -0
  121. data/spec/functional/client_spec.rb +9 -0
  122. data/spec/functional/config_spec.rb +24 -0
  123. data/spec/functional/dataset_spec.rb +77 -0
  124. data/spec/functional/project_spec.rb +24 -0
  125. data/spec/functional/table_data_spec.rb +61 -0
  126. data/spec/functional/table_spec.rb +105 -0
  127. data/spec/models/user_spec.rb +0 -0
  128. data/spec/spec_helper.rb +48 -0
  129. data/spec/support/models.rb +11 -0
  130. data/spec/support/schema.rb +43 -0
  131. metadata +370 -0
@@ -0,0 +1,15 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Be sure to restart your server when you modify this file.
3
+ #
4
+ # This file contains settings for ActionController::ParamsWrapper which
5
+ # is enabled by default.
6
+
7
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
8
+ ActiveSupport.on_load(:action_controller) do
9
+ wrap_parameters :format => [:json]
10
+ end
11
+
12
+ # Disable root element in JSON by default.
13
+ ActiveSupport.on_load(:active_record) do
14
+ self.include_root_in_json = false
15
+ end
@@ -0,0 +1,58 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: 'You need to sign in or sign up before continuing.'
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ passwords:
28
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29
+ updated: 'Your password was changed successfully. You are now signed in.'
30
+ updated_not_active: 'Your password was changed successfully.'
31
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
32
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
33
+ confirmations:
34
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
35
+ send_paranoid_instructions: 'If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
36
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
37
+ registrations:
38
+ signed_up: 'Welcome! You have signed up successfully.'
39
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
40
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
41
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
42
+ updated: 'You updated your account successfully.'
43
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
44
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
45
+ unlocks:
46
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
47
+ unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
48
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
49
+ omniauth_callbacks:
50
+ success: 'Successfully authenticated from %{kind} account.'
51
+ failure: 'Could not authenticate you from %{kind} because "%{reason}".'
52
+ mailer:
53
+ confirmation_instructions:
54
+ subject: 'Confirmation instructions'
55
+ reset_password_instructions:
56
+ subject: 'Reset password instructions'
57
+ unlock_instructions:
58
+ subject: 'Unlock Instructions'
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,26 @@
1
+ en:
2
+ simple_form:
3
+ "yes": 'Yes'
4
+ "no": 'No'
5
+ required:
6
+ text: 'required'
7
+ mark: '*'
8
+ # You can uncomment the line below if you need to overwrite the whole required html.
9
+ # When using html, text and mark won't be used.
10
+ # html: '<abbr title="required">*</abbr>'
11
+ error_notification:
12
+ default_message: "Please review the problems below:"
13
+ # Labels and hints examples
14
+ # labels:
15
+ # defaults:
16
+ # password: 'Password'
17
+ # user:
18
+ # new:
19
+ # email: 'E-mail to sign in.'
20
+ # edit:
21
+ # email: 'E-mail.'
22
+ # hints:
23
+ # defaults:
24
+ # username: 'User name to sign in.'
25
+ # password: 'No special characters, please.'
26
+
@@ -0,0 +1,4 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Rails.application.routes.draw do
3
+
4
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,11 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :name
5
+ t.boolean :admin
6
+ t.integer :phone
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddLastNameToUser < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :last_name, :string
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateLogData < ActiveRecord::Migration
2
+
3
+ def change
4
+
5
+ create_table :log_data do |t|
6
+ t.string :name
7
+ t.string :description
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+ t.string :title
5
+ t.references :user
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,39 @@
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 that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20140227015551) do
15
+
16
+ create_table "log_data", force: true do |t|
17
+ t.string "name"
18
+ t.string "description"
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
+ end
22
+
23
+ create_table "posts", force: true do |t|
24
+ t.string "title"
25
+ t.integer "user_id"
26
+ t.datetime "created_at"
27
+ t.datetime "updated_at"
28
+ end
29
+
30
+ create_table "users", force: true do |t|
31
+ t.string "name"
32
+ t.boolean "admin"
33
+ t.integer "phone"
34
+ t.datetime "created_at"
35
+ t.datetime "updated_at"
36
+ t.string "last_name"
37
+ end
38
+
39
+ end
@@ -0,0 +1 @@
1
+ {"db":{"schema_migrations":[{"version":"20140224051640"},{"version":"20140224063709"},{"version":"20140225014314"},{"version":"20140227015551"}]}}
File without changes
@@ -0,0 +1,13 @@
1
+ <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
2
+ <%%= f.error_notification %>
3
+
4
+ <div class="form-inputs">
5
+ <%- attributes.each do |attribute| -%>
6
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
7
+ <%- end -%>
8
+ </div>
9
+
10
+ <div class="form-actions">
11
+ <%%= f.button :submit %>
12
+ </div>
13
+ <%% end %>
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+ description: MyString
6
+
7
+ two:
8
+ name: MyString
9
+ description: MyString
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one: {}
8
+ # column: value
9
+ #
10
+ two: {}
11
+ # column: value
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+ admin: false
6
+ phone: 1
7
+
8
+ two:
9
+ name: MyString
10
+ admin: false
11
+ phone: 1
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class LogDataTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class UserTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
Binary file
@@ -0,0 +1,6 @@
1
+ pass_phrase: "notasecret"
2
+ pem: XXXXXXX-privatekey.p12
3
+ client_id: "XXXXXXXXX.apps.googleusercontent.com"
4
+ scope: "https://www.googleapis.com/auth/bigquery"
5
+ profile_id: "XXXXXX"
6
+ email: "XXXXXXX@developer.gserviceaccount.com"
Binary file
File without changes