relation 0.3.7 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/.watchr DELETED
@@ -1,48 +0,0 @@
1
- HH = '#' * 22 unless defined?(HH)
2
- H = '#' * 5 unless defined?(H)
3
-
4
- def usage
5
- puts <<-EOS
6
- Ctrl-\\ or ctrl-4 Running all tests
7
- Ctrl-C Exit
8
- EOS
9
- end
10
-
11
- def run(cmd)
12
- puts "#{HH} #{Time.now} #{HH}"
13
- puts "#{H} #{cmd}"
14
- system "/usr/bin/time --format '#{HH} Elapsed time %E' #{cmd}"
15
- end
16
-
17
- def run_it(type, file)
18
- case type
19
- when 'test'; run %(ruby -I test #{file})
20
- # when 'spec'; run %(rspec -X #{file})
21
- else; puts "#{H} unknown type: #{type}, file: #{file}"
22
- end
23
- end
24
-
25
- def run_all_tests
26
- puts "\n#{HH} Running all tests #{HH}\n"
27
- %w[test spec].each { |dir| run "rake #{dir}" if File.exist?(dir) }
28
- end
29
-
30
- def run_matching_files(base)
31
- base = base.split('_').first
32
- %w[test spec].each { |type|
33
- files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
34
- run_it type, files.join(' ') unless files.empty?
35
- }
36
- end
37
-
38
- %w[test spec].each { |type|
39
- watch("#{type}/#{type}_helper\.rb") { run_all_tests }
40
- watch('lib/.*\.rb') { run_all_tests }
41
- watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
42
- }
43
-
44
- # Ctrl-\ or ctrl-4
45
- Signal.trap('QUIT') { run_all_tests }
46
- # Ctrl-C
47
- Signal.trap('INT') { abort("Interrupted\n") }
48
- usage
data/Appraisals DELETED
@@ -1,15 +0,0 @@
1
- appraise 'rails-6.0' do
2
- gem 'rails', '~> 6.0.0'
3
- end
4
-
5
- appraise 'rails-5.2' do
6
- gem 'rails', '~> 5.2.0'
7
- end
8
-
9
- #appraise 'rails-5.0' do
10
- # gem 'rails', '~> 5.0.0'
11
- #end
12
- #
13
- #appraise 'rails-5.1' do
14
- # gem 'rails', '~> 5.1'
15
- #end
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.2.0"
6
-
7
- group :test do
8
- gem "observr"
9
- end
10
-
11
- gemspec path: "../"
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 6.0.0"
6
-
7
- group :test do
8
- gem "observr"
9
- end
10
-
11
- gemspec path: "../"
@@ -1,57 +0,0 @@
1
- class DB
2
- ActiveRecord::Base.establish_connection adapter: 'sqlite3',
3
- database: ':memory:'
4
-
5
- def self.setup
6
- capture_stdout do
7
- ActiveRecord::Base.logger
8
- ActiveRecord::Schema.define(version: 1) do
9
- create_table :orders do |t|
10
- t.column :name, :string
11
- end
12
- create_table :users do |t|
13
- t.column :name, :string
14
- end
15
- create_table :relations, id: false do |t|
16
- t.string :name
17
- t.references :from, null: false
18
- t.references :to, null: false
19
- end
20
- end
21
-
22
- Order.reset_column_information
23
- end
24
- end
25
-
26
- def self.teardown
27
- if ActiveRecord::Base.connection.respond_to?(:data_sources)
28
- ActiveRecord::Base.connection.data_sources.each do |table|
29
- ActiveRecord::Base.connection.drop_table(table)
30
- end
31
- else
32
- ActiveRecord::Base.connection.tables.each do |table|
33
- ActiveRecord::Base.connection.drop_table(table)
34
- end
35
- end
36
- end
37
-
38
- def self.capture_stdout
39
- real_stdout = $stdout
40
-
41
- $stdout = StringIO.new
42
- yield
43
- $stdout.string
44
- ensure
45
- $stdout = real_stdout
46
- end
47
- end
48
-
49
- class Order < ActiveRecord::Base
50
- end
51
-
52
- class User < ActiveRecord::Base
53
- end
54
-
55
- require_relative '../../app/models/relation'
56
- require_relative '../../app/models/relation_ext'
57
- require_relative '../../app/models/dangling'