spacy 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a66b907fa913c873907d54c26e262434bcb7cc18
4
+ data.tar.gz: 3f856942c8aeab8aca4ebf0c9158e250b0beed6e
5
+ SHA512:
6
+ metadata.gz: 9e5a3ad67675008e291954522536d8aca9ceef8f6414c64688249588346ba50f60ec33a6c2064552ddfae9a60230f29bcc607075ab0fd02a3c0ac500fd86dfe7
7
+ data.tar.gz: 533645d2e795b10af86891306d26fb249f482175d76f4ddefc781a6653c85e82b9c85b7020923c3d575a03a307713a575784ff05e94b6d16f4f31514c9c4308e
data/Rakefile CHANGED
@@ -1,41 +1,31 @@
1
- # -*- ruby -*-
1
+ # -*- mode: ruby; coding: utf-8 -*-
2
2
 
3
3
 
4
- require 'xot/load_path'
5
- Xot::LoadPath.unshift File.expand_path('../lib', __FILE__)
4
+ %w[../xot ../rucy ../rays ../reflex .]
5
+ .map {|s| File.expand_path "../#{s}/lib", __FILE__}
6
+ .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
6
7
 
8
+ require 'xot/rake'
9
+ require 'xot/module'
10
+ require 'rucy/module'
11
+ require 'rays/module'
12
+ require 'reflex/module'
7
13
  require 'spacy/module'
8
14
 
15
+ include Xot::Rake
9
16
 
10
- MODULE = Spacy
11
- SUBMODULES = %w[xot rucy rays reflex]
12
- TASKS = %w[git gem test submodule mac]
13
17
 
18
+ MODULES = [Xot, Rucy, Rays, Reflex, Spacy].map {|m| m.const_get :Module}
19
+ MODULE = MODULES.last
14
20
 
15
- begin
16
21
 
17
- require 'xot/rake'
18
- require 'xot/module'
19
- require 'rucy/module'
20
- require 'rays/module'
21
- require 'reflex/module'
22
+ task :default => :run
22
23
 
23
- rescue LoadError
24
-
25
- load 'task/submodule.rake'
26
-
27
- task :default => 'submodule:init'
28
-
29
- else
30
-
31
- include Xot::Rake
32
-
33
- task :default => :build
34
-
35
- task :build => :app
24
+ task :run do
25
+ sh %( ./bin/spacy )
26
+ end
36
27
 
37
- task :run => :build
28
+ empty_task :lib, :ext
38
29
 
39
- [Xot, Rucy, Rays, Reflex, Spacy].each {|m| m.load_tasks *TASKS}
40
30
 
41
- end
31
+ MODULES.each {|m| m.load_tasks :test, :doc, :gem}
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.8
data/bin/spacy CHANGED
@@ -1,13 +1,11 @@
1
- #!/Users/snori/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  # -*- mode: ruby; coding: utf-8 -*-
3
3
 
4
4
 
5
- require 'xot/load_path'
6
- (__FILE__ =~ /\/Spacy.app\// ? '../../../..' : '../..').tap do |root|
7
- Xot::LoadPath.unshift_lib File.expand_path(root, __FILE__), :spacy
8
- end
9
-
10
- require 'spacy'
5
+ %w[../xot ../rucy ../rays ../reflex .]
6
+ .map {|s| File.expand_path "../../#{s}/lib", __FILE__}
7
+ .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
11
8
 
12
9
 
13
- Spacy::Application.new.run
10
+ require 'spacy'
11
+ Spacy::Application.new.start
@@ -13,12 +13,10 @@ module Spacy
13
13
 
14
14
  def initialize ()
15
15
  super :name => 'Spacy'
16
- @window = Window.new
17
16
  end
18
17
 
19
- def run ()
20
- @window.show
21
- super
18
+ def on_start (e)
19
+ @window = Window.new.show
22
20
  end
23
21
 
24
22
  end # Application
@@ -4,7 +4,11 @@
4
4
  module Spacy
5
5
 
6
6
 
7
- extend module ModuleInfo
7
+ module Module
8
+
9
+ def name ()
10
+ super.split('::')[-2]
11
+ end
8
12
 
9
13
  def version ()
10
14
  open(root_dir 'VERSION') {|f| f.readline.chomp}
@@ -14,12 +18,12 @@ module Spacy
14
18
  File.expand_path "../../../#{path}", __FILE__
15
19
  end
16
20
 
17
- def include_dirs ()
18
- %w[include].map {|dir| root_dir dir}
21
+ def include_dir ()
22
+ root_dir 'include'
19
23
  end
20
24
 
21
- def lib_dirs ()
22
- %w[lib].map {|dir| root_dir dir}
25
+ def lib_dir ()
26
+ root_dir 'lib'
23
27
  end
24
28
 
25
29
  def task_dir ()
@@ -37,9 +41,9 @@ module Spacy
37
41
  end
38
42
  end
39
43
 
40
- self
44
+ extend self
41
45
 
42
- end# ModuleInfo
46
+ end# Module
43
47
 
44
48
 
45
49
  end# Spacy
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  require 'rays/image'
5
+ require 'rays/painter'
5
6
  require 'reflex/application'
6
7
  require 'reflex/window'
7
8
  require 'spacy/text'
@@ -14,8 +15,8 @@ module Spacy
14
15
 
15
16
  def initialize ()
16
17
  super
17
- set :title, Reflex::Application.instance.name
18
- set :bounds, 100, 100, 600, 500
18
+ set :title, Reflex::Application.instance.name
19
+ set :frame, 100, 100, 600, 500
19
20
  @text = Text.new
20
21
  p = painter
21
22
  p.background 1
@@ -24,44 +25,38 @@ module Spacy
24
25
  p.font Rays::Font.new "Menlo", 12
25
26
  end
26
27
 
27
- def update (dt)
28
- @t ||= Time.now
29
- @c ||= 0
30
- redraw
31
- @c += 1
32
- @fps = @c / (Time.now - @t)
33
- puts "#{@fps} FPS" if (@c % 100) == 0
28
+ def close ()
29
+ #Profiler__.print_profile STDOUT
30
+ super
34
31
  end
35
32
 
36
- def draw ()
37
- super
38
- paint do |p|
39
- h = p.font.height
40
- draw_text p, h
41
- draw_cursor p, h
42
- draw_fps p
43
- end
33
+ def on_update (e)
34
+ redraw
44
35
  end
45
36
 
46
- def close ()
47
- #Profiler__.print_profile STDOUT
37
+ def on_draw (e)
48
38
  super
39
+ p = e.painter
40
+ h = p.font.height
41
+ draw_text p, h
42
+ draw_cursor p, h
43
+ draw_fps p, e.fps
49
44
  end
50
45
 
51
- def key_down (key)
52
- @text.selection = key.chars
46
+ def on_key_down (e)
47
+ @text.selection = e.chars
53
48
  end
54
49
 
55
- def key_up (key)
50
+ def on_key_up (e)
56
51
  end
57
52
 
58
- def points_down (points)
53
+ def on_pointer_down (e)
59
54
  end
60
55
 
61
- def points_up (points)
56
+ def on_pointer_up (e)
62
57
  end
63
58
 
64
- def points_moved (points)
59
+ def on_pointer_move (e)
65
60
  end
66
61
 
67
62
  private
@@ -80,9 +75,8 @@ module Spacy
80
75
  p.rect x, row * lineheight, 4, lineheight
81
76
  end
82
77
 
83
- def draw_fps (p)
84
- pos = bounds(0)[1].move_by(-64, -20).to_a(2)
85
- p.text "#{@fps.to_i} FPS", *pos if @fps
78
+ def draw_fps (p, fps)
79
+ p.text "#{fps.to_i} FPS", *size.move_by(-64, -20).to_a
86
80
  end
87
81
 
88
82
  end# Window
@@ -1,9 +1,8 @@
1
1
  # -*- mode: ruby; coding: utf-8 -*-
2
2
 
3
3
 
4
- $:.unshift File.expand_path('../lib', __FILE__) do |path|
5
- $:.unshift path if !$:.include?(path) && File.directory?(path)
6
- end
4
+ File.expand_path('../lib', __FILE__)
5
+ .tap {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
7
6
 
8
7
  require 'spacy/module'
9
8
 
@@ -13,9 +12,9 @@ Gem::Specification.new do |s|
13
12
  patterns.map {|pat| Dir.glob(pat).to_a}.flatten
14
13
  end
15
14
 
16
- mod = Spacy
15
+ mod = Spacy::Module
17
16
  name = mod.name.downcase
18
- rdocs = glob.call *%w[README]
17
+ rdocs = glob.call *%w[README .doc/ext/**/*.cpp]
19
18
 
20
19
  s.name = name
21
20
  s.summary = 'A text editor written by Ruby.'
@@ -24,13 +23,14 @@ Gem::Specification.new do |s|
24
23
 
25
24
  s.authors = %w[snori]
26
25
  s.email = 'snori@xord.org'
27
- s.homepage = "http://github.com/xord/#{name}/wiki"
26
+ s.homepage = "https://github.com/xord/#{name}/wiki"
28
27
 
29
28
  s.platform = Gem::Platform::RUBY
30
29
  s.required_ruby_version = '>=1.9.0'
31
30
 
32
31
  s.add_runtime_dependency 'rake'
33
32
  s.add_runtime_dependency 'xot'
33
+ s.add_runtime_dependency 'rucy'
34
34
  s.add_runtime_dependency 'rays'
35
35
  s.add_runtime_dependency 'reflexion'
36
36
  s.add_development_dependency 'gemcutter'
@@ -0,0 +1,9 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+
4
+ %w[../xot ../rucy ../rays ../reflex .]
5
+ .map {|s| File.expand_path "../../#{s}/lib", __FILE__}
6
+ .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
7
+
8
+ require 'test/unit'
9
+ require 'spacy'
@@ -1,7 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
 
4
- require_relative 'helper'
4
+ $: << File.dirname(__FILE__)
5
+
6
+ require 'helpers'
5
7
 
6
8
 
7
9
  class TestText < Test::Unit::TestCase
@@ -1,7 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
 
4
- require_relative 'helper'
4
+ $: << File.dirname(__FILE__)
5
+
6
+ require 'helpers'
5
7
 
6
8
 
7
9
  class TestTextBuffer < Test::Unit::TestCase
@@ -1,7 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
 
4
- require_relative 'helper'
4
+ $: << File.dirname(__FILE__)
5
+
6
+ require 'helpers'
5
7
 
6
8
 
7
9
  class TestTextLine < Test::Unit::TestCase
metadata CHANGED
@@ -1,94 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
5
- prerelease:
4
+ version: 0.1.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - snori
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-06 00:00:00.000000000 Z
11
+ date: 2014-08-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: xot
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rucy
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
44
53
  - !ruby/object:Gem::Version
45
54
  version: '0'
46
55
  - !ruby/object:Gem::Dependency
47
56
  name: rays
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ! '>='
59
+ - - ">="
52
60
  - !ruby/object:Gem::Version
53
61
  version: '0'
54
62
  type: :runtime
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ! '>='
66
+ - - ">="
60
67
  - !ruby/object:Gem::Version
61
68
  version: '0'
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: reflexion
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ! '>='
73
+ - - ">="
68
74
  - !ruby/object:Gem::Version
69
75
  version: '0'
70
76
  type: :runtime
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
- - - ! '>='
80
+ - - ">="
76
81
  - !ruby/object:Gem::Version
77
82
  version: '0'
78
83
  - !ruby/object:Gem::Dependency
79
84
  name: gemcutter
80
85
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
86
  requirements:
83
- - - ! '>='
87
+ - - ">="
84
88
  - !ruby/object:Gem::Version
85
89
  version: '0'
86
90
  type: :development
87
91
  prerelease: false
88
92
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
93
  requirements:
91
- - - ! '>='
94
+ - - ">="
92
95
  - !ruby/object:Gem::Version
93
96
  version: '0'
94
97
  description: A text editor runs on Ruby and uses SPACE as a trigger key for every
@@ -100,9 +103,6 @@ extensions:
100
103
  - Rakefile
101
104
  extra_rdoc_files: []
102
105
  files:
103
- - .gitignore
104
- - .gitmodules
105
- - ChangeLog
106
106
  - Rakefile
107
107
  - VERSION
108
108
  - bin/spacy
@@ -120,36 +120,35 @@ files:
120
120
  - spacy.gemspec
121
121
  - task/mac.rake
122
122
  - task/submodule.rake
123
- - test/helper.rb
123
+ - test/helpers.rb
124
124
  - test/test_text.rb
125
125
  - test/test_textbuffer.rb
126
126
  - test/test_textline.rb
127
- homepage: http://github.com/xord/spacy/wiki
127
+ homepage: https://github.com/xord/spacy/wiki
128
128
  licenses: []
129
+ metadata: {}
129
130
  post_install_message:
130
131
  rdoc_options: []
131
132
  require_paths:
132
133
  - lib
133
134
  required_ruby_version: !ruby/object:Gem::Requirement
134
- none: false
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.9.0
139
139
  required_rubygems_version: !ruby/object:Gem::Requirement
140
- none: false
141
140
  requirements:
142
- - - ! '>='
141
+ - - ">="
143
142
  - !ruby/object:Gem::Version
144
143
  version: '0'
145
144
  requirements: []
146
145
  rubyforge_project:
147
- rubygems_version: 1.8.24
146
+ rubygems_version: 2.0.3
148
147
  signing_key:
149
- specification_version: 3
148
+ specification_version: 4
150
149
  summary: A text editor written by Ruby.
151
150
  test_files:
152
- - test/helper.rb
151
+ - test/helpers.rb
153
152
  - test/test_text.rb
154
153
  - test/test_textbuffer.rb
155
154
  - test/test_textline.rb
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *~
2
- .DS_Store
3
- Spacy.app
4
- Gemfile.lock
@@ -1,12 +0,0 @@
1
- [submodule "xot"]
2
- path = xot
3
- url = ../xot.git
4
- [submodule "rucy"]
5
- path = rucy
6
- url = ../rucy.git
7
- [submodule "rays"]
8
- path = rays
9
- url = ../rays.git
10
- [submodule "reflex"]
11
- path = reflex
12
- url = ../reflex.git
data/ChangeLog DELETED
@@ -1,3 +0,0 @@
1
- 2011-06-07 @tokujiros <tokujiros@gmail.com>
2
-
3
- * add text classes.
@@ -1,8 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
- require 'xot/load_path'
5
- Xot::LoadPath.unshift File.expand_path('../../lib', __FILE__)
6
-
7
- require 'test/unit'
8
- require 'spacy'