activerecord-oracle_enhanced-adapter 1.7.11 → 1.8.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -0
  3. data/Gemfile +20 -11
  4. data/History.md +123 -4
  5. data/RUNNING_TESTS.md +79 -55
  6. data/Rakefile +13 -19
  7. data/VERSION +1 -1
  8. data/activerecord-oracle_enhanced-adapter.gemspec +16 -17
  9. data/lib/active_record/connection_adapters/emulation/oracle_adapter.rb +1 -1
  10. data/lib/active_record/connection_adapters/oracle_enhanced/column.rb +7 -59
  11. data/lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb +6 -50
  12. data/lib/active_record/connection_adapters/oracle_enhanced/connection.rb +11 -11
  13. data/lib/active_record/connection_adapters/oracle_enhanced/context_index.rb +117 -117
  14. data/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb +30 -23
  15. data/lib/active_record/connection_adapters/oracle_enhanced/database_tasks.rb +10 -10
  16. data/lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb +48 -70
  17. data/lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb +1 -4
  18. data/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb +51 -69
  19. data/lib/active_record/connection_adapters/oracle_enhanced/oci_quoting.rb +4 -4
  20. data/lib/active_record/connection_adapters/oracle_enhanced/procedures.rb +76 -76
  21. data/lib/active_record/connection_adapters/oracle_enhanced/quoting.rb +13 -42
  22. data/lib/active_record/connection_adapters/oracle_enhanced/schema_creation.rb +60 -64
  23. data/lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb +33 -47
  24. data/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb +146 -159
  25. data/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb +94 -132
  26. data/lib/active_record/connection_adapters/oracle_enhanced/schema_statements_ext.rb +3 -3
  27. data/lib/active_record/connection_adapters/oracle_enhanced/structure_dump.rb +65 -100
  28. data/lib/active_record/connection_adapters/oracle_enhanced/version.rb +1 -1
  29. data/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +250 -487
  30. data/lib/active_record/oracle_enhanced/type/boolean.rb +7 -10
  31. data/lib/active_record/oracle_enhanced/type/integer.rb +3 -4
  32. data/lib/active_record/oracle_enhanced/type/national_character_string.rb +1 -1
  33. data/lib/active_record/oracle_enhanced/type/raw.rb +2 -3
  34. data/lib/active_record/oracle_enhanced/type/string.rb +2 -2
  35. data/lib/active_record/oracle_enhanced/type/text.rb +2 -2
  36. data/lib/activerecord-oracle_enhanced-adapter.rb +2 -2
  37. data/spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb +57 -131
  38. data/spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb +32 -34
  39. data/spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb +40 -42
  40. data/spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb +83 -85
  41. data/spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb +205 -286
  42. data/spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb +14 -6
  43. data/spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb +3 -5
  44. data/spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb +42 -49
  45. data/spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb +1 -3
  46. data/spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb +68 -71
  47. data/spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb +51 -92
  48. data/spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb +221 -327
  49. data/spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb +16 -18
  50. data/spec/spec_helper.rb +59 -57
  51. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecf7fafba601af5f9f8fb575e5b969d3a182b7ea
4
- data.tar.gz: 2f4e070cb162a4be21eb45dc747603683ef0c0bb
3
+ metadata.gz: 7f1beed345101483212d25e0040e52c3fd04c727
4
+ data.tar.gz: 75338dd46c82d721a9d5762e900444ecc41b563f
5
5
  SHA512:
6
- metadata.gz: 5357a8e895491e97b631594d594ec3c37c73a4a983864780df23ff7f906bd26dd8b916c94b986fdff881c17729b63abc0c230dbeea38ca8df725e0b8ea645ee2
7
- data.tar.gz: f1081e23da7dc9423c85c083de163841bd73c56e77c496e87d65ad970ceb927076e0e5884aad2412315cc0ea66c4a261e3047153be4ef8bd0e7933081655e4b7
6
+ metadata.gz: 821f716a5eb0bed68a572bd2c2e848e8800bedbec6fe2132fcc7bd97fd76e8e9c8d0e630b781deccc196165764afac8fc1ee65d1e5bd6019e2facfc4db2d8511
7
+ data.tar.gz: b1bcd32cb0b630b2db83c44dccf398620ff84a6032dc0876d0c38f1cb4993045b57cb6b604498e78f34928d819fc163241aeb2960021876157d4bf6aac53446e
data/.rspec CHANGED
@@ -1,2 +1,4 @@
1
1
  --color
2
2
  --backtrace
3
+ --require spec_helper
4
+ --warnings
data/Gemfile CHANGED
@@ -1,22 +1,31 @@
1
- source 'http://rubygems.org'
1
+ source "http://rubygems.org"
2
+
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
+ "https://github.com/#{repo_name}.git"
6
+ end
2
7
 
3
8
  group :development do
4
- gem 'rspec', '~> 3.3'
5
- gem 'rdoc'
6
- gem 'rake'
9
+ gem "rspec"
10
+ gem "rdoc"
11
+ gem "rake"
7
12
 
8
- gem 'activerecord', github: 'rails/rails', branch: '5-0-stable'
9
- gem 'rack', github: 'rack/rack', branch: 'master'
10
- gem 'arel', github: 'rails/arel', branch: '7-1-stable'
13
+ gem "activerecord", github: "rails/rails", branch: "master"
14
+ gem "rack", github: "rack/rack", branch: "master"
11
15
 
12
- gem 'ruby-plsql', '>=0.5.0'
16
+ gem "ruby-plsql", github: "rsim/ruby-plsql", branch: "master"
13
17
 
14
18
  platforms :ruby do
15
- gem 'ruby-oci8', github: 'kubo/ruby-oci8'
16
- gem 'byebug'
19
+ gem "ruby-oci8", github: "kubo/ruby-oci8"
20
+ gem "byebug"
17
21
  end
18
22
 
19
23
  platforms :jruby do
20
- gem 'ruby-debug'
24
+ gem "pry"
25
+ gem "pry-nav"
21
26
  end
22
27
  end
28
+
29
+ group :test do
30
+ gem "simplecov", github: "colszowka/simplecov", branch: "master", require: false
31
+ end
data/History.md CHANGED
@@ -1,11 +1,130 @@
1
- ## 1.7.11 / 2017-03-29
1
+ ## 1.8.0.beta1 / 2017-02-27
2
+
3
+ * Major enhancements
4
+ * Support Rails 5.1.0.beta1
5
+ * Fallback :bigint to :integer for primary keys [#1077]
6
+ * Drop Java SE 6 or older version of Java SE support [#1126]
7
+ * Drop JRuby 9.0.x support for Rails 5.1 [#1147]
8
+ * Refactor ColumnDumper to support consistent Virtual column with Rails [#1185]
9
+ * Schema dumper supports `t.index` in `create_table` [#1187]
10
+ * `table_exists?` only checks tables, does not check views [#1179, #1191]
11
+ * `data_sources` returns tables and views [#1192]
12
+ * `Model.table_comment` syntax is not supported anymore [#1199]
13
+ * Remove Oracle enhanced adapter own foreign key implementations [#977]
2
14
 
3
15
  * Changes and bug fixes
4
- * Bump JRuby to 9.1.8.0 and add JRUBY_OPTS [#1233]
5
- * Fix the BINARY_FLOAT column type returns nil in JRuby [#1256]
16
+ * Rails 5.1.0.beta1 is out [#1204]
17
+ * Composite foreign keys are not supported [#1188]
18
+ * Introduce `supports_virtual_columns?` [#1184]
19
+ * Made it able to change column with adding comment [#1156, #1164]
20
+ * Omit table comment option of schema.rb if it is blank [#1159]
21
+ * Fix to return nil if column comment is blank at table creation [#1158]
22
+ * `bind_param` arity change, not to take column [#1203]
23
+ * ActiveRecord `structure_dump` and `structure_load` signature changes [#1125]
24
+ * Quoting booleans should return a frozen string [#956]
25
+ * Pass `type_casted_binds` to log subscriber [#957]
26
+ * `supports_datetime_with_precision?` always returns `true` [#964]
27
+ * Handle ORA-00942 and ORA-00955 as `ActiveRecord::StatementInvalid` [#1093]
28
+ * Raise `ActiveRecord::StatementInvalid` at `rename_index` when old index does not exist [#1195]
29
+ * Handle `ORA-01418: specified index does not exist` as `ActiveRecord::StatementInvalid` [#1195]
30
+ * Raise ActiveRecord::NotNullViolation when OCIError: ORA-01400 [#1174]
31
+ * Rails 5.1 : insert into `returning_id` not working since rails/rails#26002 [#988, #1088]
32
+ * Make `exec_{insert,update}` signatures consistent [#966]
33
+ * Introduce OracleEnhanced `ColumnMethods` module and `AlterTable` `Table` classes [#1081]
34
+ * `empty_insert_statement_value` is not implemented [#1180]
35
+ * Switch to keyword args for `type_to_sql` [#1167, #1168]
36
+ * Replace `all_timestamp_attributes` with `all_timestamp_attributes_in_model` [#1129]
37
+ * `current_database` returns the expected database name [#1135]
38
+ * Use `supports_foreign_keys_in_create?` [#1143]
39
+ * Address `add_column` gets `ArgumentError: wrong number of arguments` [#1157, #1170]
40
+ * Address `change_column` `ArgumentError: wrong number of arguments` [#1171, #1172]
41
+ * SchemaDumper should not dump views as tables [#1192]
42
+ * Use Abstract `select_rows(arel, name = nil, binds = [])` [#1132]
43
+ * Address `OCIError: ORA-01756: quoted string not properly terminated:` [#1102]
44
+ * Use `table_exists?` and `tables` [#1170, #1178]
45
+ * Move `ActiveModel::Type::Text` to `ActiveRecord::Type::Text` [#1082]
46
+ * Support schema option for views [#1190]
47
+ * Quote table and trigger names containing sinqle quote character [#1192]
48
+ * Restore :raw type migration support [#1176]
49
+ * Refactor Boolean type by removing duplicate code [#1047]
50
+ * Remove deprecated methods to get and set columns [#958]
51
+ * Remove `is_?` deprecated methods [#959]
52
+ * Remove `quote_date_with_to_date` and `quote_timestamp_with_to_timestamp` #960
53
+ * Remove unnecessary comments in Type [#961]
54
+ * Remove options[:default] for virtual columns [#962]
55
+ * Remove `self.emulate_dates` and `self.emulate_dates_by_column_name` [#963]
56
+ * Delete `self.boolean_to_string` [#967]
57
+ * Delete Oracle enhanced its own `join_to_update` [#968]
58
+ * Remove `self.ignore_table_columns` [#969]
59
+ * Remove unused `self.virtual_columns` [#970]
60
+ * Remove `dump_schema_information` and `initialize_schema_migrations_table` [#972]
61
+ * Remove `fallback_string_to_date`, `fallback_string_to_time` [#974, #975, #1112]
62
+ * Remove `dependent` option from `add_foreign_key` [#976]
63
+ * Remove specs testing Rails `self.ignored_columns` features [#987]
64
+ * Remove `add_foreign_key` specs with `table_name_prefix` and `table_name_suffix` [#990]
65
+ * Remove `type_cast` method just calling super [#1201]
66
+ * Remove `ids_in_list_limit` alias [#1202]
67
+ * Remove unused comments from data types spec [#1079]
68
+ * Remove deprecated `table_exists?` and `tables` [#1100, #1178]
69
+ * Remove deprecated `name` argument from `#tables` [#1189]
70
+ * Prefer `SYS_CONTEXT` function than `v$nls_parameters` view [#1107]
71
+ * `initialize_schema_migrations_table` method has been removed [#1144]
72
+ * `index_name_exists?` at schema statements spec is not necessary [#1197]
73
+ * Remove comments for `data_source_exists?` [#1200]
74
+ * Address DEPRECATION WARNING: Passing a column to `quote` has been deprecated. [#978]
75
+ * Deprecate `supports_primary_key?` [#1177]
76
+ * Deprecate passing `default` to `index_name_exists?` [#1175]
77
+ * Suppress `add_index_options` method `DEPRECATION WARNING:` [#1193]
78
+ * Suppress `remove_index` method deprecation warning [#1194]
79
+ * Suppress DEPRECATION WARNING at `rename_index` [#1195]
80
+ * Suppress `oracle_enhanced_adapter.rb:591: warning: assigned but unused` [#1198]
81
+ * Use rails rubocop setting [#1111]
82
+ * Rubocop addresses `Extra empty line detected at class body beginning.` [#1078]
83
+ * Address `Lint/EndAlignment` offences by changing code ifself [#1113]
84
+ * rubocop `AlignWith` has been renamed to `EnforcedStyleAlignWith` [#1142]
85
+ * Add `Style/EmptyLinesAroundMethodBody` [#1173]
86
+ * Address git warnings: [#1000]
87
+ * Update `required_rubygems_version` just following rails.gemspec [#1110]
88
+ * Use the latest ruby-plsql while developing alpha version [#1114]
89
+ * Use the latest arel master while developing alpha version [#1115]
90
+ * Bump Arel to 8.0 [#1120, #1121, #1124]
91
+ * Use released Arel 8 [#1205]
92
+ * Remove duplicate license information [#965]
93
+ * Clean up comments and un-commented specs for table comment feature [#971]
94
+ * Use Rails migration `create_table` to create table and sequence [#991]
95
+ * Removed a invalid spec about TIMESTAMP column [#1020]
96
+ * Remove specs which set `attribute :hire_date, :date` [#1024]
97
+ * Remove version specification for rspec [#1055]
98
+ * Suppress `create_table(:test_employees, {:force=>true})` message [#1080]
99
+ * Perform `drop_table :test_employees` [#1087]
100
+ * Address rspec deprecation warning [#1089]
101
+ * Suppress rspec warning [#1101]
102
+ * Suppress `Dropped database 'ORCL'` messages while running rspec [#1103]
103
+ * Address rspec warnings by checking with `raise_errors_for_deprecations!` [#1104]
104
+ * `clear_cache!` always exists at least since Rails 4.0 [#1106]
105
+ * Use SimpleCov [#1108]
106
+ * Enable RSpec `--warnings` option [#1116]
107
+ * Remove entry for rcov since it already migrated to simplecov [#1118]
108
+ * Add spec for #1149 `TypeError: can't cast Java::JavaSql::Timestamp` [#1152]
109
+ * Remove a duplicated specs [#1163]
110
+ * Specify `--require spec_helper` in .rspec [#1186]
111
+ * Add 'pry' and 'pry-nav' for JRuby debug [#973]
112
+ * Remove ruby-debug [#1196]
113
+ * Use Ubuntu Trusty at travis [#1095]
114
+ * Address travis.yml has multilpe language entries [#1109]
115
+ * Use docker-oracle-xe-11g for Travis CI [#1117]
116
+ * Modify `JRUBY_OPTS` for Travis CI [#1119]
117
+ * Add ruby-head and jruby-head to .travis.yml [#1127]
118
+ * Use JRuby 9.1.7.0 [#1138]
119
+ * Add JRuby 9.0.4.0 and allow JRuby 9.0.5.0 failures [#1146]
120
+ * Tiny fix for .travis.yml after migrating to docker-oracle-xe-11g [#1183]
121
+ * Templates updated to use Rails master branch for Rails 5.1 [#1133]
122
+ * Update running tests to include rails-dev-box [#1140]
6
123
 
7
124
  * Known issues
8
- * No changes since 1.7.7
125
+ * Legacy primary key support testing [#1207]
126
+ * PrimaryKeyIntegerNilDefaultTest failures [#1162]
127
+ * Skip `explain should explain query with bind` with JRuby [#1091]
9
128
 
10
129
  ## 1.7.10 / 2017-02-03
11
130
 
data/RUNNING_TESTS.md CHANGED
@@ -1,83 +1,107 @@
1
- Creating the test database
2
- --------------------------
1
+ # When and Which tests need to be executed
3
2
 
4
- You need Oracle database (version 10.2 or later) with SYS and SYSTEM user access.
3
+ When you are creating a fix and/or some new features for Oracle enhanced adapter,
4
+ It is recommended to execute Oracle enhanced adapter unit tests and ActiveRecord unit tests.
5
5
 
6
- If you are on a Mac OS X 10.6 then use [these instructions](http://blog.rayapps.com/2009/09/14/how-to-install-oracle-database-10g-on-mac-os-x-snow-leopard) to install local Oracle DB 10.2.0.4. Other option is to use Linux VM and install Oracle DB on it.
6
+ * Oracle enhanced adapter unit test
7
+ * ActiveRecord unit test
7
8
 
8
- If you are on Linux (or will use Linux virtual machine) and need Oracle DB just for running tests then Oracle DB XE edition is enough. See [Oracle XE downloads page](http://www.oracle.com/technetwork/database/express-edition/downloads/index.html) for download links and instructions.
9
+ This document explains how to prepare and execute Oracle enhanced adapter unit test.
10
+ For ActiveRecord unit test, please refer [Contributing to Ruby on Rails](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html) .
9
11
 
10
- If you are getting ORA-12520 errors when running tests then it means that Oracle cannot create enough processes to handle many connections (as during tests many connections are created and destroyed). In this case you need to log in as SYSTEM user and execute e.g.
12
+ This document talks about developing Oracle enhanced adapter itself, does NOT talk about developing Rails applications using Oracle enhanced adapter.
11
13
 
12
- alter system set processes=200 scope=spfile;
14
+ # Building development and test environment
13
15
 
14
- to increase process limit and then restart the database (this will be necessary if Oracle XE will be used as default processes limit is 40).
16
+ You can create Oracle enhanced adapter development and test environment by following one of them. If you are first to create this environment
17
+ [rails-dev-box runs_oracle branch](https://github.com/yahonda/rails-dev-box/tree/runs_oracle) is recommended.
15
18
 
16
- ### Docker
17
- If no Oracle database with SYS and SYSTEM user access is available, try the docker approach.
19
+ ## [rails-dev-box runs_oracle branch](https://github.com/yahonda/rails-dev-box/tree/runs_oracle)
20
+ * Please follow the [README](https://github.com/yahonda/rails-dev-box/tree/runs_oracle#a-virtual-machine-for-ruby-on-rails-core-development-with-oracle-database) .
18
21
 
19
- Install [Docker](https://docker.github.io/engine/installation/)
22
+ ## [rails-dev-box runs_oracle_on_docker branch](https://github.com/yahonda/rails-dev-box/tree/runs_oracle_on_docker)
23
+ * Please follow the [README](https://github.com/yahonda/rails-dev-box/blob/runs_oracle_on_docker/README.md#a-virtual-machine-for-ruby-on-rails-core-development) .
20
24
 
21
- Pull [docker-oracle-xe-11g](https://hub.docker.com/r/wnameless/oracle-xe-11g/) image from docker hub
25
+ ## Create by yourself
26
+ You can create your development and test environment by yourself.
22
27
 
23
- docker pull wnameless/oracle-xe-11g
28
+ ### Install Ruby
29
+ Install Ruby 2.2.2 or higher version of Ruby and JRuby 9.0.5 or higher. To switch multiple version of ruby, you can use use [ruby-build](https://github.com/rbenv/ruby-build) or [Ruby Version Manager(RVM)](https://rvm.io/).
24
30
 
25
- Start a Oracle database docker container with mapped ports. Use port `49161` to access the database.
31
+ ### Creating the test database
32
+ To test Oracle enhanced adapter Oracle database is necesssary. You can build by your own or use the Docker to run pre-build Oracle Database Express Edition 11g Release 2.
26
33
 
27
- docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g
34
+ #### Create database by yourself
35
+ Oracle database 11.2 or later with SYS and SYSTEM user access. AL32UTF8 database character set is recommended.
28
36
 
29
- Check connection to the database with `sqlplus`. The user is `system`, the password is `oracle`.
37
+ #### Docker
38
+ If no Oracle database with SYS and SYSTEM user access is available, try the docker approach.
30
39
 
31
- sqlplus64 system/oracle@localhost:49161
40
+ * Install [Docker](https://docker.github.io/engine/installation/)
32
41
 
33
- The oracle enhanced configuration file `spec/spec_config.yaml` should look like:
42
+ * Pull [docker-oracle-xe-11g](https://hub.docker.com/r/wnameless/oracle-xe-11g/) image from docker hub
43
+ ```sh
44
+ $ docker pull wnameless/oracle-xe-11g
45
+ ```
34
46
 
35
- ```yaml
36
- # copy this file to spec/config.yaml and set appropriate values
37
- # you can also use environment variables, see spec_helper.rb
38
- database:
39
- name: 'xe'
40
- host: 'localhost'
41
- port: 49161
42
- user: 'oracle_enhanced'
43
- password: 'oracle_enhanced'
44
- sys_password: 'oracle'
45
- non_default_tablespace: 'SYSTEM'
46
- timezone: 'Europe/Riga'
47
- ```
47
+ * Start a Oracle database docker container with mapped ports. Use port `49161` to access the database.
48
+ ```sh
49
+ $ docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g
50
+ ```
48
51
 
49
- Ruby versions
50
- -------------
52
+ * Check connection to the database with `sqlplus`. The user is `system`, the password is `oracle`.
53
+ ```sh
54
+ $ sqlplus64 system/oracle@localhost:49161
55
+ ```
51
56
 
52
- oracle_enhanced is tested with MRI 2.1.x and 2.2.x, and JRuby 1.7.x and 9.0.x.x.
53
57
 
54
- It is recommended to use [RVM](http://rvm.beginrescueend.com) to run tests with different Ruby implementations.
55
-
56
- Running tests
57
- -------------
58
+ ### Creating database schemas at the test database
58
59
 
59
60
  * Create Oracle database schema for test purposes. Review `spec/spec_helper.rb` to see default schema/user names and database names (use environment variables to override defaults)
60
61
 
61
- SQL> CREATE USER oracle_enhanced IDENTIFIED BY oracle_enhanced;
62
- SQL> GRANT unlimited tablespace, create session, create table, create sequence, create procedure, create trigger, create view, create materialized view, create database link, create synonym, create type, ctxapp TO oracle_enhanced;
63
-
64
- SQL> CREATE USER oracle_enhanced_schema IDENTIFIED BY oracle_enhanced_schema;
65
- SQL> GRANT unlimited tablespace, create session, create table, create sequence, create procedure, create trigger, create view, create materialized view, create database link, create synonym, create type, ctxapp TO oracle_enhanced_schema;
62
+ ```sql
63
+ SQL> CREATE USER oracle_enhanced IDENTIFIED BY oracle_enhanced;
64
+ SQL> GRANT unlimited tablespace, create session, create table, create sequence, create procedure, create trigger, create view, create materialized view, create database link, create synonym, create type, ctxapp TO oracle_enhanced;
66
65
 
67
- * If you use RVM then switch to corresponding Ruby. It is recommended to create isolated gemsets for test purposes (e.g. rvm create gemset oracle_enhanced)
68
-
69
- * Install bundler with
70
-
71
- gem install bundler
72
-
73
- * Install necessary gems with
66
+ SQL> CREATE USER oracle_enhanced_schema IDENTIFIED BY oracle_enhanced_schema;
67
+ SQL> GRANT unlimited tablespace, create session, create table, create sequence, create procedure, create trigger, create view, create materialized view, create database link, create synonym, create type, ctxapp TO oracle_enhanced_schema;
68
+ ```
74
69
 
75
- bundle install
70
+ ### Configure database login credentials
76
71
 
77
72
  * Configure database credentials in one of two ways:
78
- * copy spec/spec_config.yaml.template to spec/spec_config.yaml and modify as needed
73
+ * copy `spec/spec_config.yaml.template` to `spec/spec_config.yaml` and modify as needed
79
74
  * set required environment variables (see DATABASE_NAME in spec_helper.rb)
80
75
 
81
- * Run tests with
82
-
83
- rake spec
76
+ * The oracle enhanced configuration file `spec/spec_config.yaml` should look like:
77
+
78
+ ```yaml
79
+ # copy this file to spec/config.yaml and set appropriate values
80
+ # you can also use environment variables, see spec_helper.rb
81
+ database:
82
+ name: 'xe'
83
+ host: 'localhost'
84
+ port: 49161
85
+ user: 'oracle_enhanced'
86
+ password: 'oracle_enhanced'
87
+ sys_password: 'oracle'
88
+ non_default_tablespace: 'SYSTEM'
89
+ timezone: 'Europe/Riga'
90
+ ```
91
+
92
+ # Running Oracle enhanced adapter unit tests
93
+
94
+ * Install bundler
95
+ ```sh
96
+ $ gem install bundler
97
+ ```
98
+
99
+ * Execute bundle install to install required gems
100
+ ```sh
101
+ $ bundle install
102
+ ```
103
+
104
+ * Run Oracle enhanced adapter unit tests
105
+ ```sh
106
+ $ bundle exec rake spec
107
+ ```
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- require 'bundler/gem_tasks'
1
+ require "rubygems"
2
+ require "bundler"
3
+ require "bundler/gem_tasks"
4
4
  begin
5
5
  Bundler.setup(:default, :development)
6
6
  rescue Bundler::BundlerError => e
@@ -9,16 +9,11 @@ rescue Bundler::BundlerError => e
9
9
  exit e.status_code
10
10
  end
11
11
 
12
- require 'rake'
12
+ require "rake"
13
13
 
14
- require 'rspec/core/rake_task'
14
+ require "rspec/core/rake_task"
15
15
  RSpec::Core::RakeTask.new(:spec)
16
16
 
17
- RSpec::Core::RakeTask.new(:rcov) do |t|
18
- t.rcov = true
19
- t.rcov_opts = ['--exclude', '/Library,spec/']
20
- end
21
-
22
17
  desc "Clear test database"
23
18
  task :clear do
24
19
  require "./spec/spec_helper"
@@ -28,18 +23,17 @@ task :clear do
28
23
  ActiveRecord::Base.connection.execute("PURGE RECYCLEBIN") rescue nil
29
24
  end
30
25
 
31
- # Clear test database before running spec and rcov
32
- task :spec => :clear
33
- task :rcov => :clear
26
+ # Clear test database before running spec
27
+ task spec: :clear
34
28
 
35
- task :default => :spec
29
+ task default: :spec
36
30
 
37
- require 'rdoc/task'
31
+ require "rdoc/task"
38
32
  Rake::RDocTask.new do |rdoc|
39
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
33
+ version = File.exist?("VERSION") ? File.read("VERSION") : ""
40
34
 
41
- rdoc.rdoc_dir = 'doc'
35
+ rdoc.rdoc_dir = "doc"
42
36
  rdoc.title = "activerecord-oracle_enhanced-adapter #{version}"
43
- rdoc.rdoc_files.include('README*')
44
- rdoc.rdoc_files.include('lib/**/*.rb')
37
+ rdoc.rdoc_files.include("README*")
38
+ rdoc.rdoc_files.include("lib/**/*.rb")
45
39
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.11
1
+ 1.8.0.beta1
@@ -1,16 +1,16 @@
1
1
  Gem::Specification.new do |s|
2
- s.name = %q{activerecord-oracle_enhanced-adapter}
3
- s.version = "1.7.11"
2
+ s.name = "activerecord-oracle_enhanced-adapter"
3
+ s.version = "1.8.0.beta1"
4
4
 
5
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
- s.required_ruby_version = '>= 2.2.2'
7
- s.license = 'MIT'
8
- s.authors = [%q{Raimonds Simanovskis}]
9
- s.date = %q{2017-03-29}
10
- s.description = %q{Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
5
+ s.required_rubygems_version = ">= 1.8.11"
6
+ s.required_ruby_version = ">= 2.2.2"
7
+ s.license = "MIT"
8
+ s.authors = ["Raimonds Simanovskis"]
9
+ s.date = "2016-12-26"
10
+ s.description = 'Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
11
11
  This adapter is superset of original ActiveRecord Oracle adapter.
12
- }
13
- s.email = %q{raimonds.simanovskis@gmail.com}
12
+ '
13
+ s.email = "raimonds.simanovskis@gmail.com"
14
14
  s.extra_rdoc_files = [
15
15
  "README.md"
16
16
  ]
@@ -68,9 +68,9 @@ This adapter is superset of original ActiveRecord Oracle adapter.
68
68
  "spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb",
69
69
  "spec/spec_helper.rb"
70
70
  ]
71
- s.homepage = %q{http://github.com/rsim/oracle-enhanced}
72
- s.require_paths = [%q{lib}]
73
- s.summary = %q{Oracle enhanced adapter for ActiveRecord}
71
+ s.homepage = "http://github.com/rsim/oracle-enhanced"
72
+ s.require_paths = ["lib"]
73
+ s.summary = "Oracle enhanced adapter for ActiveRecord"
74
74
  s.test_files = [
75
75
  "spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb",
76
76
  "spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb",
@@ -87,8 +87,7 @@ This adapter is superset of original ActiveRecord Oracle adapter.
87
87
  "spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb",
88
88
  "spec/spec_helper.rb"
89
89
  ]
90
- s.add_runtime_dependency(%q<activerecord>, ["~> 5.0.0"])
91
- s.add_runtime_dependency(%q<arel>, ["~> 7.1.4"])
92
- s.add_runtime_dependency(%q<ruby-plsql>, [">= 0.5.0"])
93
- s.license = 'MIT'
90
+ s.add_runtime_dependency("activerecord", ["~> 5.1.0.beta"])
91
+ s.add_runtime_dependency("arel", ["~> 8.0"])
92
+ s.add_runtime_dependency("ruby-plsql")
94
93
  end