nodes 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/{LICENSE.txt → MIT-LICENSE} +2 -4
- data/README.md +20 -16
- data/Rakefile +40 -1
- data/app/assets/config/nodes_manifest.js +2 -0
- data/app/assets/javascripts/nodes/application.js +13 -0
- data/app/assets/stylesheets/nodes/application.css +15 -0
- data/app/controllers/nodes/application_controller.rb +5 -0
- data/app/helpers/nodes/application_helper.rb +4 -0
- data/app/jobs/nodes/application_job.rb +4 -0
- data/app/mailers/nodes/application_mailer.rb +6 -0
- data/app/models/nodes/application_record.rb +5 -0
- data/app/views/layouts/nodes/application.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/lib/nodes/engine.rb +11 -0
- data/lib/nodes/version.rb +1 -1
- data/lib/nodes.rb +3 -33
- data/lib/tasks/nodes_tasks.rake +4 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config/application.rb +18 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +54 -0
- data/spec/dummy/config/environments/production.rb +91 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +56 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/log/development.log +7 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/{CHANGELOG.md → spec/dummy/public/apple-touch-icon-precomposed.png} +0 -0
- data/{ROADMAP.md → spec/dummy/public/apple-touch-icon.png} +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/spec/fixtures/nodes/nodes.yml +53 -0
- data/spec/spec_helper.rb +18 -0
- metadata +207 -29
- data/Gemfile +0 -4
- data/bin/nodes +0 -81
- data/lib/nodes/file_node.rb +0 -37
- data/lib/nodes/node.rb +0 -63
- data/lib/nodes/point.rb +0 -57
- data/lib/rails/model.rb +0 -16
- data/metadata +0 -85
- data/nodes.gemspec +0 -20
metadata
CHANGED
@@ -1,61 +1,239 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Eugene Markine
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
11
|
+
date: 2017-07-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.1.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.1.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: capybara
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: factory_girl_rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Lightweight editor of text nodes
|
15
84
|
email:
|
16
|
-
-
|
17
|
-
executables:
|
18
|
-
- nodes
|
85
|
+
- emarkine@gmail.com
|
86
|
+
executables: []
|
19
87
|
extensions: []
|
20
88
|
extra_rdoc_files: []
|
21
89
|
files:
|
22
|
-
-
|
23
|
-
- Gemfile
|
24
|
-
- LICENSE.txt
|
90
|
+
- MIT-LICENSE
|
25
91
|
- README.md
|
26
|
-
- ROADMAP.md
|
27
92
|
- Rakefile
|
28
|
-
-
|
93
|
+
- app/assets/config/nodes_manifest.js
|
94
|
+
- app/assets/javascripts/nodes/application.js
|
95
|
+
- app/assets/stylesheets/nodes/application.css
|
96
|
+
- app/controllers/nodes/application_controller.rb
|
97
|
+
- app/helpers/nodes/application_helper.rb
|
98
|
+
- app/jobs/nodes/application_job.rb
|
99
|
+
- app/mailers/nodes/application_mailer.rb
|
100
|
+
- app/models/nodes/application_record.rb
|
101
|
+
- app/views/layouts/nodes/application.html.erb
|
102
|
+
- config/routes.rb
|
29
103
|
- lib/nodes.rb
|
30
|
-
- lib/nodes/
|
31
|
-
- lib/nodes/node.rb
|
32
|
-
- lib/nodes/point.rb
|
104
|
+
- lib/nodes/engine.rb
|
33
105
|
- lib/nodes/version.rb
|
34
|
-
- lib/
|
35
|
-
-
|
36
|
-
-
|
37
|
-
|
38
|
-
|
106
|
+
- lib/tasks/nodes_tasks.rake
|
107
|
+
- spec/dummy/Rakefile
|
108
|
+
- spec/dummy/app/assets/config/manifest.js
|
109
|
+
- spec/dummy/app/assets/javascripts/application.js
|
110
|
+
- spec/dummy/app/assets/javascripts/cable.js
|
111
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
112
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
113
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
114
|
+
- spec/dummy/app/controllers/application_controller.rb
|
115
|
+
- spec/dummy/app/helpers/application_helper.rb
|
116
|
+
- spec/dummy/app/jobs/application_job.rb
|
117
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
118
|
+
- spec/dummy/app/models/application_record.rb
|
119
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
120
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
121
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
122
|
+
- spec/dummy/bin/bundle
|
123
|
+
- spec/dummy/bin/rails
|
124
|
+
- spec/dummy/bin/rake
|
125
|
+
- spec/dummy/bin/setup
|
126
|
+
- spec/dummy/bin/update
|
127
|
+
- spec/dummy/bin/yarn
|
128
|
+
- spec/dummy/config.ru
|
129
|
+
- spec/dummy/config/application.rb
|
130
|
+
- spec/dummy/config/boot.rb
|
131
|
+
- spec/dummy/config/cable.yml
|
132
|
+
- spec/dummy/config/database.yml
|
133
|
+
- spec/dummy/config/environment.rb
|
134
|
+
- spec/dummy/config/environments/development.rb
|
135
|
+
- spec/dummy/config/environments/production.rb
|
136
|
+
- spec/dummy/config/environments/test.rb
|
137
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
138
|
+
- spec/dummy/config/initializers/assets.rb
|
139
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
140
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
141
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
142
|
+
- spec/dummy/config/initializers/inflections.rb
|
143
|
+
- spec/dummy/config/initializers/mime_types.rb
|
144
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
145
|
+
- spec/dummy/config/locales/en.yml
|
146
|
+
- spec/dummy/config/puma.rb
|
147
|
+
- spec/dummy/config/routes.rb
|
148
|
+
- spec/dummy/config/secrets.yml
|
149
|
+
- spec/dummy/config/spring.rb
|
150
|
+
- spec/dummy/log/development.log
|
151
|
+
- spec/dummy/package.json
|
152
|
+
- spec/dummy/public/404.html
|
153
|
+
- spec/dummy/public/422.html
|
154
|
+
- spec/dummy/public/500.html
|
155
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
156
|
+
- spec/dummy/public/apple-touch-icon.png
|
157
|
+
- spec/dummy/public/favicon.ico
|
158
|
+
- spec/dummy/tmp/pids/server.pid
|
159
|
+
- spec/fixtures/nodes/nodes.yml
|
160
|
+
- spec/spec_helper.rb
|
161
|
+
homepage: https://github.com/emarkine/db-model
|
162
|
+
licenses:
|
163
|
+
- MIT
|
164
|
+
metadata: {}
|
39
165
|
post_install_message:
|
40
166
|
rdoc_options: []
|
41
167
|
require_paths:
|
42
168
|
- lib
|
43
169
|
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
170
|
requirements:
|
46
|
-
- -
|
171
|
+
- - ">="
|
47
172
|
- !ruby/object:Gem::Version
|
48
173
|
version: '0'
|
49
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
175
|
requirements:
|
52
|
-
- -
|
176
|
+
- - ">="
|
53
177
|
- !ruby/object:Gem::Version
|
54
178
|
version: '0'
|
55
179
|
requirements: []
|
56
180
|
rubyforge_project:
|
57
|
-
rubygems_version:
|
181
|
+
rubygems_version: 2.6.12
|
58
182
|
signing_key:
|
59
|
-
specification_version:
|
60
|
-
summary:
|
61
|
-
test_files:
|
183
|
+
specification_version: 4
|
184
|
+
summary: Nodes Editor
|
185
|
+
test_files:
|
186
|
+
- spec/dummy/config.ru
|
187
|
+
- spec/dummy/config/puma.rb
|
188
|
+
- spec/dummy/config/cable.yml
|
189
|
+
- spec/dummy/config/routes.rb
|
190
|
+
- spec/dummy/config/secrets.yml
|
191
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
192
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
193
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
194
|
+
- spec/dummy/config/initializers/assets.rb
|
195
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
196
|
+
- spec/dummy/config/initializers/inflections.rb
|
197
|
+
- spec/dummy/config/initializers/mime_types.rb
|
198
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
199
|
+
- spec/dummy/config/spring.rb
|
200
|
+
- spec/dummy/config/environment.rb
|
201
|
+
- spec/dummy/config/environments/development.rb
|
202
|
+
- spec/dummy/config/environments/production.rb
|
203
|
+
- spec/dummy/config/environments/test.rb
|
204
|
+
- spec/dummy/config/database.yml
|
205
|
+
- spec/dummy/config/application.rb
|
206
|
+
- spec/dummy/config/boot.rb
|
207
|
+
- spec/dummy/config/locales/en.yml
|
208
|
+
- spec/dummy/tmp/pids/server.pid
|
209
|
+
- spec/dummy/Rakefile
|
210
|
+
- spec/dummy/bin/update
|
211
|
+
- spec/dummy/bin/rake
|
212
|
+
- spec/dummy/bin/rails
|
213
|
+
- spec/dummy/bin/yarn
|
214
|
+
- spec/dummy/bin/bundle
|
215
|
+
- spec/dummy/bin/setup
|
216
|
+
- spec/dummy/log/development.log
|
217
|
+
- spec/dummy/app/assets/config/manifest.js
|
218
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
219
|
+
- spec/dummy/app/assets/javascripts/application.js
|
220
|
+
- spec/dummy/app/assets/javascripts/cable.js
|
221
|
+
- spec/dummy/app/jobs/application_job.rb
|
222
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
223
|
+
- spec/dummy/app/controllers/application_controller.rb
|
224
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
225
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
226
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
227
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
228
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
229
|
+
- spec/dummy/app/helpers/application_helper.rb
|
230
|
+
- spec/dummy/app/models/application_record.rb
|
231
|
+
- spec/dummy/package.json
|
232
|
+
- spec/dummy/public/422.html
|
233
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
234
|
+
- spec/dummy/public/404.html
|
235
|
+
- spec/dummy/public/favicon.ico
|
236
|
+
- spec/dummy/public/500.html
|
237
|
+
- spec/dummy/public/apple-touch-icon.png
|
238
|
+
- spec/spec_helper.rb
|
239
|
+
- spec/fixtures/nodes/nodes.yml
|
data/Gemfile
DELETED
data/bin/nodes
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# == Synopsis
|
4
|
-
# Nodes is a data warehouse in the form of meta tags, which may have additional values.
|
5
|
-
# Users can add, delete, edit nodes, manage access rights, etc.
|
6
|
-
#
|
7
|
-
# == Examples
|
8
|
-
# This command create new nodes in current directory:
|
9
|
-
# nodes init
|
10
|
-
#
|
11
|
-
# Other examples:
|
12
|
-
# nodes put
|
13
|
-
# nodes del
|
14
|
-
#
|
15
|
-
# == Usage
|
16
|
-
# nodes [options]
|
17
|
-
#
|
18
|
-
# For help use: nodes -h
|
19
|
-
#
|
20
|
-
# == Options
|
21
|
-
# -h, --help Displays help message
|
22
|
-
# -v, --version Display the version, then exit
|
23
|
-
# TO DO - add additional options
|
24
|
-
#
|
25
|
-
# == Author
|
26
|
-
# Eugene Markine
|
27
|
-
#
|
28
|
-
# == Copyright
|
29
|
-
# Copyright (c) 2013 EugeneLab. Licensed under the GNU General Public License (GPL), Version 2:
|
30
|
-
# http://www.opensource.org/licenses/gpl-2.0.php
|
31
|
-
|
32
|
-
# TO DO - change license if necessary
|
33
|
-
|
34
|
-
#require 'rubygems'
|
35
|
-
#require "nodes"
|
36
|
-
|
37
|
-
require "#{File.dirname(__FILE__)}/../lib/nodes"
|
38
|
-
|
39
|
-
commands_help = "Commands:\n" \
|
40
|
-
" init Init new nodes\n" \
|
41
|
-
" list List of nodes on the nodes\n" \
|
42
|
-
" del Delete the nodes \n" \
|
43
|
-
" get Get changes from server\n" \
|
44
|
-
" put Put changes to server\n" \
|
45
|
-
" size Size of the nodes\n" \
|
46
|
-
"\n"
|
47
|
-
|
48
|
-
usage_help = "usage: nodes command [arguments...] [options...]\n\n" + commands_help
|
49
|
-
|
50
|
-
unless ARGV.first
|
51
|
-
puts "Nodes #{Nodes::VERSION}"
|
52
|
-
puts usage_help
|
53
|
-
exit
|
54
|
-
end
|
55
|
-
|
56
|
-
command = ARGV.shift
|
57
|
-
#dir = ARGV.first
|
58
|
-
#dir = Dir.pwd unless dir
|
59
|
-
|
60
|
-
#puts "find: #{ARGV.find "-h"}"
|
61
|
-
|
62
|
-
|
63
|
-
case command
|
64
|
-
when 'version'
|
65
|
-
puts "Nodes #{Nodes::VERSION}"
|
66
|
-
when 'init'
|
67
|
-
Nodes.init
|
68
|
-
when 'list'
|
69
|
-
Nodes.list
|
70
|
-
when 'put'
|
71
|
-
Nodes.put
|
72
|
-
when 'get'
|
73
|
-
Nodes.get
|
74
|
-
when 'del'
|
75
|
-
Nodes.del
|
76
|
-
when 'size'
|
77
|
-
Nodes.size
|
78
|
-
else
|
79
|
-
puts "Unknown command: #{command}\n"
|
80
|
-
puts commands_help
|
81
|
-
end
|
data/lib/nodes/file_node.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require "./node"
|
2
|
-
require 'digest/sha2'
|
3
|
-
|
4
|
-
|
5
|
-
class FileNode < Node
|
6
|
-
|
7
|
-
def initialize(file=nil)
|
8
|
-
super
|
9
|
-
file = __FILE__ unless file
|
10
|
-
file = File.expand_path(file)
|
11
|
-
if File.stat(file).file?
|
12
|
-
@keys['name'] = File.basename(file)
|
13
|
-
#@keys['path'] = File.dirname(file)
|
14
|
-
@keys['size'] = File.size(file)
|
15
|
-
sha2 = Digest::SHA2.new
|
16
|
-
File.open(file, 'r') do |fh|
|
17
|
-
while buffer = fh.read(1024)
|
18
|
-
sha2 << buffer
|
19
|
-
end
|
20
|
-
end
|
21
|
-
@keys['hash'] = sha2.hexdigest
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
#
|
28
|
-
#node = FileNode.new
|
29
|
-
#puts "yaml:"
|
30
|
-
#puts node.to_yaml
|
31
|
-
#puts
|
32
|
-
#puts "marshal:"
|
33
|
-
#puts Marshal.dump(node)
|
34
|
-
#p node.name
|
35
|
-
#p node.path
|
36
|
-
#p node.size
|
37
|
-
#p node.hash
|
data/lib/nodes/node.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
|
3
|
-
class Node
|
4
|
-
|
5
|
-
attr_accessor :keys
|
6
|
-
|
7
|
-
#
|
8
|
-
#attr_accessor :up, :down
|
9
|
-
#attr_accessor :left, :right
|
10
|
-
#attr_accessor :front, :back
|
11
|
-
#attr_accessor :previous, :next
|
12
|
-
#
|
13
|
-
#attr_accessor :store # directory where this node stored
|
14
|
-
|
15
|
-
def initialize(name=nil)
|
16
|
-
@keys = {}
|
17
|
-
@keys['name'] = name
|
18
|
-
end
|
19
|
-
|
20
|
-
def hash
|
21
|
-
@keys['hash']
|
22
|
-
end
|
23
|
-
|
24
|
-
def name=(name)
|
25
|
-
@keys['name'] = name
|
26
|
-
end
|
27
|
-
|
28
|
-
def tags=(tags)
|
29
|
-
@keys['tags'] = tags
|
30
|
-
end
|
31
|
-
|
32
|
-
def method_missing(name, *args, &block)
|
33
|
-
if @keys.key?(name.to_s)
|
34
|
-
@keys[name.to_s]
|
35
|
-
else
|
36
|
-
super
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def ==(other)
|
41
|
-
return self.size == other.size && self.hash == other.hash
|
42
|
-
end
|
43
|
-
|
44
|
-
def dump(filename=nil)
|
45
|
-
filename = ".#{self.class.name}.yml" unless filename
|
46
|
-
File.open(filename, "w") do |file|
|
47
|
-
file.write self.to_yaml
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def self.load(filename=nil)
|
52
|
-
filename = ".#{self.name}.yml" unless filename
|
53
|
-
YAML::load_file(filename)
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
#node = Node.new("ирбиш")
|
61
|
-
#node = Node.new("irbish")
|
62
|
-
#p node.name
|
63
|
-
#p node.keys
|
data/lib/nodes/point.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require "./node"
|
2
|
-
require "./file_node"
|
3
|
-
|
4
|
-
class Point < Node
|
5
|
-
|
6
|
-
def initialize(path=nil)
|
7
|
-
super
|
8
|
-
path = File.dirname(__FILE__) unless path
|
9
|
-
@keys['name'] = File.basename(path)
|
10
|
-
@keys['path'] = path
|
11
|
-
files = []
|
12
|
-
Dir.glob("**/*").each do |filename|
|
13
|
-
filepath = "#{path}/#{filename}"
|
14
|
-
if File.stat(filepath).file?
|
15
|
-
file = FileNode.new(filepath)
|
16
|
-
tags = File.dirname(filename).split(File::SEPARATOR)
|
17
|
-
file.tags = tags if tags[0] != "."
|
18
|
-
files << file
|
19
|
-
end
|
20
|
-
end
|
21
|
-
@keys['size'] = files.inject(0){|sum,file| sum + file.size }
|
22
|
-
sha2 = Digest::SHA2.new
|
23
|
-
files.each do |file|
|
24
|
-
sha2 << file.hash
|
25
|
-
end
|
26
|
-
@keys['hash'] = sha2.hexdigest
|
27
|
-
@keys['list'] = files
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
#node = Point.new
|
34
|
-
#p node.list
|
35
|
-
|
36
|
-
|
37
|
-
#
|
38
|
-
#node = Point.new
|
39
|
-
#node.dump
|
40
|
-
#p node.size
|
41
|
-
#puts node.hash
|
42
|
-
#node = Point.load
|
43
|
-
#p node.size
|
44
|
-
#puts node.hash
|
45
|
-
|
46
|
-
|
47
|
-
#node.files.each do |file|
|
48
|
-
# p file
|
49
|
-
#end
|
50
|
-
#p node.size
|
51
|
-
#p node.hash
|
52
|
-
#
|
53
|
-
#puts "yaml:"
|
54
|
-
#puts node.to_yaml
|
55
|
-
#puts
|
56
|
-
#puts "marshal:"
|
57
|
-
#puts Marshal.dump(node)
|
data/lib/rails/model.rb
DELETED
data/metadata
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
2
|
-
name: nodes
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease: false
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 7
|
9
|
-
version: 0.1.7
|
10
|
-
platform: ruby
|
11
|
-
authors:
|
12
|
-
- Eugene Markine
|
13
|
-
autorequire:
|
14
|
-
bindir: bin
|
15
|
-
cert_chain: []
|
16
|
-
|
17
|
-
date: 2010-11-12 00:00:00 +01:00
|
18
|
-
default_executable:
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
name: rspec
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
|
-
requirements:
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
|
-
type: :development
|
32
|
-
version_requirements: *id001
|
33
|
-
description: Nodes is a data warehouse in the form of meta tags, which may have additional values
|
34
|
-
email:
|
35
|
-
- emarkine@gmail.com
|
36
|
-
executables:
|
37
|
-
- point
|
38
|
-
extensions: []
|
39
|
-
|
40
|
-
extra_rdoc_files: []
|
41
|
-
|
42
|
-
files:
|
43
|
-
- bin/command.rb
|
44
|
-
- bin/point
|
45
|
-
- lib/nodes.rb
|
46
|
-
- LICENSE
|
47
|
-
- README.md
|
48
|
-
- ROADMAP.md
|
49
|
-
- CHANGELOG.md
|
50
|
-
has_rdoc: true
|
51
|
-
homepage: http://eugenelab.com/nodes
|
52
|
-
licenses: []
|
53
|
-
|
54
|
-
post_install_message:
|
55
|
-
rdoc_options: []
|
56
|
-
|
57
|
-
require_paths:
|
58
|
-
- lib
|
59
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
-
none: false
|
61
|
-
requirements:
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
segments:
|
65
|
-
- 0
|
66
|
-
version: "0"
|
67
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
|
-
requirements:
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
segments:
|
73
|
-
- 1
|
74
|
-
- 3
|
75
|
-
- 6
|
76
|
-
version: 1.3.6
|
77
|
-
requirements: []
|
78
|
-
|
79
|
-
rubyforge_project: nodes
|
80
|
-
rubygems_version: 1.3.7
|
81
|
-
signing_key:
|
82
|
-
specification_version: 3
|
83
|
-
summary: Nodes is data management system based on OS files system
|
84
|
-
test_files: []
|
85
|
-
|
data/nodes.gemspec
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'nodes/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |gem|
|
7
|
-
gem.name = "nodes"
|
8
|
-
gem.version = Nodes::VERSION
|
9
|
-
gem.date = Time.now.strftime('%Y-%m-%d')
|
10
|
-
gem.summary = "easy manipulator of related nodes"
|
11
|
-
gem.description = "Nodes is a system of interconnected nodes through the named connections."
|
12
|
-
gem.authors = ["Eugene Markine"]
|
13
|
-
gem.email = ["eugene@markine.nl"]
|
14
|
-
gem.homepage = "http://eugenelab.com"
|
15
|
-
|
16
|
-
gem.files = `git ls-files`.split($/)
|
17
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
-
gem.require_paths = ["lib"]
|
20
|
-
end
|