gtk3assist 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gtk3assist"
8
- s.version = "0.0.8"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = "2012-10-01"
12
+ s.date = "2013-02-24"
13
13
  s.description = "A class for making it easier to develop Gtk3 based applications with the 'gir_ffi-gtk'-gem."
14
14
  s.email = "k@spernj.org"
15
15
  s.extra_rdoc_files = [
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.homepage = "http://github.com/kaspernj/gtk3assist"
43
43
  s.licenses = ["MIT"]
44
44
  s.require_paths = ["lib"]
45
- s.rubygems_version = "1.8.24"
45
+ s.rubygems_version = "1.8.25"
46
46
  s.summary = "A class for making it easier to develop Gtk3 based applications with the 'gir_ffi-gtk'-gem."
47
47
 
48
48
  if s.respond_to? :specification_version then
@@ -12,14 +12,31 @@ class Gtk3assist::Threadding
12
12
  @time = 100
13
13
  end
14
14
 
15
+ @method = self.method(:enable_threadding_pass)
16
+
15
17
  #Call the method (which then calls itself based on timings).
16
18
  enable_threadding_pass
17
19
  end
18
20
 
21
+ #Only enables the threadding if it is necessary (its not necessary on JRuby).
22
+ def self.enable_threadding_if_necessary(args = nil)
23
+ if RUBY_ENGINE != "jruby"
24
+ enable = true
25
+ else
26
+ enable = false
27
+ end
28
+
29
+ Gtk3assist::Threadding.enable_threadding(args) if enable
30
+ end
31
+
19
32
  private
20
33
 
21
34
  #Passes to another running thread. Based on the time something else is running, the pass will be called again as soon as possible or waiting a small amount of time to check again if not.
22
35
  def self.enable_threadding_pass(*args)
36
+ GLib.idle_add(GLib::PRIORITY_DEFAULT_IDLE, Proc.new{Thread.pass; sleep 0.01; true}, nil, nil)
37
+
38
+ return nil
39
+
23
40
  t_begin = Time.now.to_f
24
41
  Thread.pass
25
42
  t_run = Time.now.to_f - t_begin
@@ -29,14 +46,14 @@ class Gtk3assist::Threadding
29
46
  Thread.pass
30
47
 
31
48
  #Run again after a small amount of time to prevent 100% CPU.
32
- GLib.timeout_add(GLib::PRIORITY_DEFAULT_IDLE, @time, self.method(:enable_threadding_pass), nil, nil)
49
+ GLib.timeout_add(GLib::PRIORITY_DEFAULT_IDLE, @time, @method, nil, nil)
33
50
  return false
34
51
  else
35
52
  #Somehow the idle or timeout gets ignored unless this is here.
36
53
  Thread.pass
37
54
 
38
55
  #Run again on next idle.
39
- GLib.idle_add(GLib::PRIORITY_DEFAULT_IDLE, self.method(:enable_threadding_pass), nil, nil)
56
+ GLib.idle_add(GLib::PRIORITY_DEFAULT_IDLE, @method, nil, nil)
40
57
  return false
41
58
  end
42
59
  end
metadata CHANGED
@@ -1,93 +1,121 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gtk3assist
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
4
5
  prerelease:
5
- version: 0.0.8
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Kasper Johansen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-10-01 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2013-02-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: gir_ffi-gtk
17
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
27
31
  name: xml-simple
28
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
29
33
  none: false
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
34
38
  type: :runtime
35
39
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
38
47
  name: rspec
39
- requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
40
49
  none: false
41
- requirements:
50
+ requirements:
42
51
  - - ~>
43
- - !ruby/object:Gem::Version
52
+ - !ruby/object:Gem::Version
44
53
  version: 2.8.0
45
54
  type: :development
46
55
  prerelease: false
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.8.0
62
+ - !ruby/object:Gem::Dependency
49
63
  name: rdoc
50
- requirement: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
51
65
  none: false
52
- requirements:
66
+ requirements:
53
67
  - - ~>
54
- - !ruby/object:Gem::Version
55
- version: "3.12"
68
+ - !ruby/object:Gem::Version
69
+ version: '3.12'
56
70
  type: :development
57
71
  prerelease: false
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '3.12'
78
+ - !ruby/object:Gem::Dependency
60
79
  name: bundler
61
- requirement: &id005 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
62
81
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
66
85
  version: 1.0.0
67
86
  type: :development
68
87
  prerelease: false
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 1.0.0
94
+ - !ruby/object:Gem::Dependency
71
95
  name: jeweler
72
- requirement: &id006 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
73
97
  none: false
74
- requirements:
98
+ requirements:
75
99
  - - ~>
76
- - !ruby/object:Gem::Version
100
+ - !ruby/object:Gem::Version
77
101
  version: 1.8.4
78
102
  type: :development
79
103
  prerelease: false
80
- version_requirements: *id006
81
- description: A class for making it easier to develop Gtk3 based applications with the 'gir_ffi-gtk'-gem.
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.8.4
110
+ description: A class for making it easier to develop Gtk3 based applications with
111
+ the 'gir_ffi-gtk'-gem.
82
112
  email: k@spernj.org
83
113
  executables: []
84
-
85
114
  extensions: []
86
-
87
- extra_rdoc_files:
115
+ extra_rdoc_files:
88
116
  - LICENSE.txt
89
117
  - README.rdoc
90
- files:
118
+ files:
91
119
  - .document
92
120
  - .rspec
93
121
  - Gemfile
@@ -110,34 +138,32 @@ files:
110
138
  - spec/gtk3assist_treeview_spec.rb
111
139
  - spec/spec_helper.rb
112
140
  homepage: http://github.com/kaspernj/gtk3assist
113
- licenses:
141
+ licenses:
114
142
  - MIT
115
143
  post_install_message:
116
144
  rdoc_options: []
117
-
118
- require_paths:
145
+ require_paths:
119
146
  - lib
120
- required_ruby_version: !ruby/object:Gem::Requirement
147
+ required_ruby_version: !ruby/object:Gem::Requirement
121
148
  none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 3126877064269841651
126
- segments:
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ segments:
127
154
  - 0
128
- version: "0"
129
- required_rubygems_version: !ruby/object:Gem::Requirement
155
+ hash: -1530953432067750217
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
157
  none: false
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: "0"
158
+ requirements:
159
+ - - ! '>='
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
135
162
  requirements: []
136
-
137
163
  rubyforge_project:
138
- rubygems_version: 1.8.24
164
+ rubygems_version: 1.8.25
139
165
  signing_key:
140
166
  specification_version: 3
141
- summary: A class for making it easier to develop Gtk3 based applications with the 'gir_ffi-gtk'-gem.
167
+ summary: A class for making it easier to develop Gtk3 based applications with the
168
+ 'gir_ffi-gtk'-gem.
142
169
  test_files: []
143
-