clevic 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
data/tasks/rdoc.rake ADDED
@@ -0,0 +1,16 @@
1
+ # remove hoe documentation task
2
+ Rake::Task['docs'].clear
3
+
4
+ # make this respond to docs, so it fits in with the rest of the build
5
+ Rake::RDocTask.new do |rdoc|
6
+ rdoc.name = :docs
7
+ rdoc.title = "Clevic DB UI builder"
8
+ rdoc.main = 'README.txt'
9
+ rdoc.rdoc_dir = 'doc'
10
+ rdoc.rdoc_files.include %w{History.txt lib/**/*.rb README.txt TODO}
11
+ rdoc.options += [
12
+ '-SHN',
13
+ '-A', 'property=Property',
14
+ "--opname=index.html",
15
+ ]
16
+ end
@@ -87,29 +87,6 @@ class TestCacheTable < Test::Unit::TestCase
87
87
  assert_equal OrderAttribute.new( Passenger, 'row asc' ), ct.order_attributes[2]
88
88
  end
89
89
 
90
- should 'not have new record on empty' do
91
- # without auto_new
92
- (0...Passenger.count).each do |i|
93
- @cache_table.delete_at 0
94
- @cache_table.delete_at 0
95
- @cache_table.delete_at 0
96
- end
97
- assert_equal 0, @cache_table.size
98
- end
99
-
100
- should 'have new record on empty' do
101
- #with auto_new
102
- @cache_table = @cache_table.renew( :auto_new => true )
103
- assert !@cache_table.options.has_key?( :auto_new ), "CacheTable should not have :auto_new in options"
104
- (0...Passenger.count).each do |i|
105
- @cache_table.delete_at 0
106
- @cache_table.delete_at 0
107
- @cache_table.delete_at 0
108
- end
109
-
110
- assert_equal 1, @cache_table.size
111
- end
112
-
113
90
  should 'return nil for a nil parameter' do
114
91
  assert_nil @cache_table.index_for_entity( nil )
115
92
  end
@@ -0,0 +1,61 @@
1
+ require File.dirname(__FILE__) + '/test_helper'
2
+ require 'clevic/table_model.rb'
3
+
4
+ class PopulateCachePassengers < ActiveRecord::Migration
5
+ def self.up
6
+ Passenger.create :name => 'John Anderson', :flight => Flight.find_by_number('EK211'), :row => 36, :seat => 'A', :nationality => 'UAE'
7
+ Passenger.create :name => 'Genie', :flight => Flight.find_by_number('CA001'), :row => 1, :seat => 'A', :nationality => 'Canada'
8
+ Passenger.create :name => 'Aladdin', :flight => Flight.find_by_number('CA001'), :row => 2, :seat => 'A', :nationality => 'Canada'
9
+ end
10
+
11
+ def self.down
12
+ Passenger.delete :all
13
+ end
14
+ end
15
+
16
+ # need to set up a test DB, and test data for this
17
+ class TestTableModel < Test::Unit::TestCase
18
+ def self.startup
19
+ PopulateCachePassengers.up
20
+ end
21
+
22
+ def self.shutdown
23
+ PopulateCachePassengers.down
24
+ end
25
+
26
+
27
+ def setup
28
+ @table_model = Clevic::TableModel.new( )
29
+ end
30
+
31
+ def teardown
32
+ end
33
+
34
+ should "be an empty shell" do
35
+ assert true
36
+ end
37
+
38
+ should_eventually 'not have new record on empty' do
39
+ # without auto_new
40
+ (0...Passenger.count).each do |i|
41
+ @table_model.delete_at 0
42
+ @table_model.delete_at 0
43
+ @table_model.delete_at 0
44
+ end
45
+ assert_equal 0, @table_model.size
46
+ end
47
+
48
+ should_eventually 'have new record on empty' do
49
+ #with auto_new
50
+ @table_model = @table_model.renew( :auto_new => true )
51
+ assert !@table_model.options.has_key?( :auto_new ), "CacheTable should not have :auto_new in options"
52
+ (0...Passenger.count).each do |i|
53
+ @table_model.delete_at 0
54
+ @table_model.delete_at 0
55
+ @table_model.delete_at 0
56
+ end
57
+
58
+ assert_equal 1, @table_model.size
59
+ end
60
+
61
+ end
@@ -139,7 +139,7 @@ class TestTableSearcher < Test::Unit::TestCase
139
139
  @simple_search_criteria.from_start = true
140
140
  @simple_search_criteria.search_text = Flight.find(:first).number
141
141
  flight_field = Clevic::Field.new( :flight, Passenger, {} )
142
- assert_nil flight_field.path
142
+ assert_nil flight_field.display
143
143
  assert_raise RuntimeError do
144
144
  table_searcher = Clevic::TableSearcher.new( Passenger, [@id_order_attribute], @simple_search_criteria, flight_field )
145
145
  table_searcher.search
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clevic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Anderson
@@ -9,9 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-30 00:00:00 +02:00
12
+ date: 2009-09-02 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.2
24
+ version:
15
25
  - !ruby/object:Gem::Dependency
16
26
  name: qtext
17
27
  type: :runtime
@@ -20,7 +30,7 @@ dependencies:
20
30
  requirements:
21
31
  - - ">="
22
32
  - !ruby/object:Gem::Version
23
- version: 0.6.2
33
+ version: 0.6.5
24
34
  version:
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: activerecord
@@ -50,7 +60,27 @@ dependencies:
50
60
  requirements:
51
61
  - - ">="
52
62
  - !ruby/object:Gem::Version
53
- version: 0.0.3
63
+ version: 0.0.4
64
+ version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: facets
67
+ type: :runtime
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 2.4.1
74
+ version:
75
+ - !ruby/object:Gem::Dependency
76
+ name: newgem
77
+ type: :development
78
+ version_requirement:
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: 1.3.0
54
84
  version:
55
85
  - !ruby/object:Gem::Dependency
56
86
  name: hoe
@@ -80,8 +110,6 @@ files:
80
110
  - Rakefile
81
111
  - TODO
82
112
  - bin/clevic
83
- - config/hoe.rb
84
- - config/requirements.rb
85
113
  - lib/clevic/dirty.rb
86
114
  - lib/clevic.rb
87
115
  - lib/clevic/browser.rb
@@ -91,6 +119,7 @@ files:
91
119
  - lib/clevic/delegates.rb
92
120
  - lib/clevic/extensions.rb
93
121
  - lib/clevic/field.rb
122
+ - lib/clevic/filter_command.rb
94
123
  - lib/clevic/item_delegate.rb
95
124
  - lib/clevic/model_builder.rb
96
125
  - lib/clevic/model_column.rb
@@ -101,6 +130,7 @@ files:
101
130
  - lib/clevic/table_model.rb
102
131
  - lib/clevic/table_searcher.rb
103
132
  - lib/clevic/table_view.rb
133
+ - lib/clevic/text_delegate.rb
104
134
  - lib/clevic/view.rb
105
135
  - lib/clevic/ui/.gitignore
106
136
  - lib/clevic/ui/browser.ui
@@ -122,6 +152,8 @@ files:
122
152
  - sql/times.sql
123
153
  - sql/times_sqlite.sql
124
154
  - tasks/website.rake
155
+ - tasks/clevic.rake
156
+ - tasks/rdoc.rake
125
157
  - test/test_cache_table.rb
126
158
  - test/test_helper.rb
127
159
  - test/test_model_index_extensions.rb
@@ -130,7 +162,9 @@ files:
130
162
  - test/test_table_searcher.rb
131
163
  has_rdoc: true
132
164
  homepage: http://clevic.rubyforge.org
133
- post_install_message: ""
165
+ licenses: []
166
+
167
+ post_install_message:
134
168
  rdoc_options:
135
169
  - --main
136
170
  - README.txt
@@ -151,13 +185,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
185
  requirements: []
152
186
 
153
187
  rubyforge_project: clevic
154
- rubygems_version: 1.3.1
188
+ rubygems_version: 1.3.5
155
189
  signing_key:
156
- specification_version: 2
157
- summary: SQL table GUI with Qt
190
+ specification_version: 3
191
+ summary: Database framework and Qt Model/View GUI for data capture and editing of tables in a pre-existing relational DBMS
158
192
  test_files:
159
193
  - test/test_model_index_extensions.rb
160
194
  - test/test_cache_table.rb
195
+ - test/test_table_model.rb
161
196
  - test/test_table_searcher.rb
162
197
  - test/test_order_attribute.rb
163
198
  - test/test_helper.rb
data/config/hoe.rb DELETED
@@ -1,82 +0,0 @@
1
- require 'clevic/version'
2
-
3
- AUTHOR = 'John Anderson' # can also be an array of Authors
4
- EMAIL = "panic@semiosix.com"
5
- DESCRIPTION = "SQL table GUI with Qt"
6
- GEM_NAME = 'clevic' # what ppl will type to install your gem
7
- RUBYFORGE_PROJECT = 'clevic' # The unix name for your project
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
10
- EXTRA_DEPENDENCIES = [
11
- ['qtext', '>=0.6.2'],
12
- ['activerecord', '>=2.0.2'],
13
- ['fastercsv', '>=1.2.3'],
14
- ['gather', '>=0.0.3']
15
- # This isn't always installed from gems
16
- #~ ['qtruby4', '>=1.4.9']
17
- # bsearch can't be installed from gems
18
- ] # An array of rubygem dependencies [name, version]
19
-
20
- @config_file = "~/.rubyforge/user-config.yml"
21
- @config = nil
22
- RUBYFORGE_USERNAME = "panic"
23
- def rubyforge_username
24
- unless @config
25
- begin
26
- @config = YAML.load(File.read(File.expand_path(@config_file)))
27
- rescue
28
- puts <<-EOS
29
- ERROR: No rubyforge config file found: #{@config_file}
30
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
31
- - See http://newgem.rubyforge.org/rubyforge.html for more details
32
- EOS
33
- exit
34
- end
35
- end
36
- RUBYFORGE_USERNAME.replace @config["username"]
37
- end
38
-
39
-
40
- REV = nil
41
- # UNCOMMENT IF REQUIRED:
42
- # REV = YAML.load(`svn info`)['Revision']
43
- VERS = Clevic::VERSION::STRING + (REV ? ".#{REV}" : "")
44
- RDOC_OPTS = ['--quiet', '--title', 'clevic documentation',
45
- "--opname", "index.html",
46
- "--line-numbers",
47
- "--main", "README",
48
- #~ '--accessor=property',
49
- '-A', 'property=Property',
50
- '--format=darkfish',
51
- "--inline-source"]
52
-
53
- class Hoe
54
- def extra_deps
55
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
56
- @extra_deps
57
- end
58
- end
59
-
60
- # Generate all the Rake tasks
61
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
62
- $hoe = Hoe.new(GEM_NAME, VERS) do |p|
63
- p.developer(AUTHOR, EMAIL)
64
- p.description = DESCRIPTION
65
- p.summary = DESCRIPTION
66
- p.url = HOMEPATH
67
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
68
- p.test_globs = ["test/**/test_*.rb"]
69
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
70
-
71
- # == Optional
72
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
73
- p.extra_deps = EXTRA_DEPENDENCIES
74
-
75
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
76
- end
77
-
78
- CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
79
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
80
- $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
81
- $hoe.rsync_args = '-av --delete --ignore-errors'
82
- $hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
@@ -1,15 +0,0 @@
1
- require 'fileutils'
2
- include FileUtils
3
-
4
- require 'rubygems'
5
- %w[rake hoe newgem rubigen].each do |req_gem|
6
- begin
7
- require req_gem
8
- rescue LoadError
9
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
- puts "Installation: gem install #{req_gem} -y"
11
- exit
12
- end
13
- end
14
-
15
- $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))