visualruby 3.0.23 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c9875dc7a7e491c539661b24beb1f82ae9800ff
4
- data.tar.gz: cb5116d5521afb53cb20b5c00baeb73b19d92eac
3
+ metadata.gz: ba9a01f856cbf0b63959f1594e7562ccb164bfb1
4
+ data.tar.gz: 9c0936f16c0daf499fe1957c1a011aad94805f79
5
5
  SHA512:
6
- metadata.gz: 2185e832ea7999cf184a7967d5b58a0b7f799d67938cd2d7389eba8653969ce841cb9e674176f64ad58f3841364a8787fa50ed87bb7b013427d7e7266b1fdf2d
7
- data.tar.gz: 46a0b8df4685f384fe99ea0724c0f111a8cf46b46dd5818ea7103115af5bb144accfc459d76d5c21f9b10341609f10901056a3765182e96215020ef79bfe6602
6
+ metadata.gz: db216647fe5143893255fbf0eee9768bd6ee8bdfc2a1ff1fa7f9368d0a47c74cf7949f174fe4033236d2817b5b5760159af4047c8007993dc40977324bf70570
7
+ data.tar.gz: 79f0a78b6ad273f7fb9aad781ebbfd7e59afdeeaa1823d4fdc66c339bae5d0891b59607471f6e9045172df3713d9f25a40752f03bc11638ac611511fbb8b72aa
data/.vr_settings.yaml CHANGED
@@ -15,17 +15,27 @@ open_files:
15
15
  - "/home/eric/vrp/vr3/src/main/GemTree.rb"
16
16
  - "/home/eric/vrp/vr3/lib/treeview/FileTreeView.rb"
17
17
  - "/home/eric/vrp/vr3/lib/treeview/columns/TreeViewColumn.rb"
18
- - "/home/eric/vrp/vr3/lib/treeview/ListView.rb"
19
- - "/home/eric/vrp/vr3/lib/treeview/ViewCommon.rb"
20
18
  - "/home/eric/vrp/vr3/lib/treeview/columns/ComboCol.rb"
21
19
  - "/home/eric/vrp/vr3/lib/treeview/columns/ImageCol.rb"
20
+ - "/home/eric/vrp/vr3/vr.gemspec"
21
+ - "/home/eric/vrp/vr3/src/main/VR_Tools.rb"
22
+ - "/home/eric/vrp/vr3/lib/treeview/TreeView.rb"
23
+ - "/home/eric/vrp/vr3/examples/active_record2/main.rb"
24
+ - "/home/eric/vrp/vr3/examples/filetreeview/bin/ProjectTreeGUI.rb"
25
+ - "/home/eric/vrp/vr3/lib/treeview/ListView.rb"
26
+ - "/home/eric/vrp/vr3/doc/file_list.html"
27
+ - "/home/eric/vrp/vr3/doc/class_and_method_list.html"
28
+ - "/home/eric/vrp/vr3/doc/just_file_list.html"
22
29
  open_folders:
23
30
  - "/home/eric/vrp/vr3"
24
- - "/home/eric/vrp/vr3/site"
31
+ - "/home/eric/vrp/vr3/doc"
32
+ - "/home/eric/vrp/vr3/lib"
33
+ - "/home/eric/vrp/vr3/lib/treeview"
34
+ - "/home/eric/vrp/vr3/lib/treeview/columns"
25
35
  - "/home/eric/vrp/vr3/src"
26
36
  - "/home/eric/vrp/vr3/src/main"
27
- current_file: "/home/eric/vrp/vr3/lib/treeview/columns/ImageCol.rb"
28
- current_line: 4
37
+ current_file: "/home/eric/vrp/vr3/doc/just_file_list.html"
38
+ current_line: 83
29
39
  rdoc_command_line: yardoc lib - site/*.*
30
40
  builder: !ruby/object:Gtk::Builder {}
31
41
  top_level_window: false
data/doc/img/logo.png ADDED
Binary file
@@ -29,6 +29,7 @@ class Calculator
29
29
  [ 4, 5, 6, "+" ] +
30
30
  [ 7, 8, 9, "-" ] +
31
31
  [ 0, ".","/","=" ]
32
+ @clear_display = false
32
33
  end
33
34
 
34
35
  # This method is called when any key is clicked. It follows
@@ -46,18 +47,26 @@ class Calculator
46
47
  def button__clicked(button)
47
48
  case button.label
48
49
  when "C" then
49
- @builder["display"].text = ""
50
+ clear_display
50
51
  when "=" then
51
52
  begin # this doesn't catch all errors
52
53
  @builder["display"].text = eval(@builder["display"].text).to_s
53
54
  rescue
54
55
  @builder["display"].text = "error"
55
56
  end
57
+ @clear_display = true
58
+ when /[0-9]/ then
59
+ clear_display if @clear_display
60
+ @builder["display"].text = @builder["display"].text + button.label
56
61
  else
57
62
  @builder["display"].text = @builder["display"].text + button.label
58
63
  end
59
64
  end
60
65
 
66
+ def clear_display
67
+ @builder["display"].text = ""
68
+ @clear_display = false
69
+ end
61
70
 
62
71
 
63
72
  end
@@ -39,14 +39,24 @@ module VR
39
39
  load_columns(cls)
40
40
  end
41
41
 
42
+ # def add_active_record_rows(ar) # :nodoc:
43
+ # ar.each do |obj|
44
+ # row = add_row()
45
+ # matches = obj.attributes.keys & @column_keys #intersection
46
+ # matches.each { |field| row[field] = obj.attributes[field] }
47
+ # end
48
+ # end
49
+
42
50
  def add_active_record_rows(ar) # :nodoc:
51
+ fields = ar.column_names.map { |x| x.to_sym }
52
+ matches = fields & @column_keys #intersection
43
53
  ar.each do |obj|
44
54
  row = add_row()
45
- matches = obj.attributes.keys & @column_keys #intersection
46
- matches.each { |field| row[field] = obj.attributes[field] }
55
+ matches.each { |f| row[f] = obj[f] unless obj[f].nil? }
47
56
  end
48
57
  end
49
58
 
59
+
50
60
  def []( row ) # :nodoc:
51
61
  model.get_iter(Gtk::TreePath.new("#{row}"))
52
62
  end
@@ -111,7 +111,7 @@ module VR
111
111
 
112
112
  module ViewCommon
113
113
 
114
- attr_accessor :vr_renderer
114
+ attr_accessor :vr_renderer, :column_keys
115
115
 
116
116
  def load_columns(cols) # :nodoc:
117
117
  @vr_renderer = {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visualruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.23
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Cunningham
@@ -9,36 +9,36 @@ autorequire:
9
9
  bindir:
10
10
  - "."
11
11
  cert_chain: []
12
- date: 2016-09-02 00:00:00.000000000 Z
12
+ date: 2017-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gtk3
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 3.0.0
20
+ version: 3.1.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 3.0.0
27
+ version: 3.1.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: gtksourceview3
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 3.0.0
34
+ version: 3.1.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 3.0.0
41
+ version: 3.1.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: require_all
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,7 @@ extra_rdoc_files: []
66
66
  files:
67
67
  - "./.vr_settings.yaml"
68
68
  - "./.yardoc/my_yard.yaml"
69
+ - "./doc/img/logo.png"
69
70
  - "./examples/active_record/.vr_settings.yaml"
70
71
  - "./examples/active_record/active_record.rb"
71
72
  - "./examples/active_record/bin/ChoosePerson.rb"