nydp 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 070df0ab7e597dbbcb8e80aca7f4c6dbc444d0e9
4
- data.tar.gz: a772c25f02d36b78842698bd798704dda414490c
3
+ metadata.gz: 33480122f9608ad9c13fe61c3ed534ce73765ddd
4
+ data.tar.gz: 27712f0e21be0cb53af53fb37bb8dc89c72c71fd
5
5
  SHA512:
6
- metadata.gz: 50400bf553e7bf65c4514f7922c0ab57f2a31ea7971f2626b45e55747bdc1994172dbae3a111350ce3a33d9933653845b19654099309991f164dae1e81f611a9
7
- data.tar.gz: cf5d1475f6c57fd4dde96969ca0b469e3a1a3b9f8a338d1af237931b88d4e1eaab9ad49da6cc69872dbda56afe90f40f9468ba829b6290b10d42c7a1160a6684
6
+ metadata.gz: f4f0fb3458cf76450c64e19cddd0dc03633108aa45cc7d1f5a72fb546d446c7e0ea435e8dc913af54efaddbb707aae8ac588a0d0f2492415e0f00ca664da4fa2
7
+ data.tar.gz: 9cfd74432153243de497df5e50451248dc8ae0555a2032631243b102fc1af3358ba6734530ee55fd8d467cdbb49054e1b62a5de7c13bc9fa788bdea42a8a41a2
data/.gitignore CHANGED
@@ -15,4 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ lib/lisp/scratch.nydp
18
19
  .#*
data/Rakefile CHANGED
@@ -1 +1,4 @@
1
1
  require "bundler/gem_tasks"
2
+ require "nydp"
3
+
4
+ Nydp.rake_tasks
data/lib/nydp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nydp
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/nydp.rb CHANGED
@@ -1,4 +1,18 @@
1
1
  module Nydp
2
+ LOADFILES = []
3
+
4
+ def self.rake_tasks
5
+ load relative_path 'tasks/tests.rake'
6
+ end
7
+
8
+ def self.relative_path name
9
+ File.join File.expand_path(File.dirname(__FILE__)), name
10
+ end
11
+
12
+ LOADFILES << relative_path('lisp/boot.nydp')
13
+ LOADFILES << relative_path('lisp/test-runner.nydp')
14
+ Dir.glob(relative_path 'lisp/tests/**/*.nydp').each { |f| LOADFILES << f }
15
+
2
16
  def self.compile_and_eval vm, expr
3
17
  vm.thread Pair.new(Compiler.compile(expr, Nydp.NIL), Nydp.NIL)
4
18
  end
@@ -104,8 +118,7 @@ module Nydp
104
118
  root_ns = { }
105
119
  setup(root_ns)
106
120
  vm = VM.new
107
- boot_path = File.join File.expand_path(File.dirname(__FILE__)), 'lisp/boot.nydp'
108
- StreamRunner.new(vm, root_ns, File.new(boot_path)).run
121
+ LOADFILES.each { |f| StreamRunner.new(vm, root_ns, File.new(f)).run }
109
122
  Repl.new(vm, root_ns, $stdin).run
110
123
  end
111
124
 
@@ -114,14 +127,7 @@ module Nydp
114
127
  root_ns = { }
115
128
  setup(root_ns)
116
129
  vm = VM.new
117
- boot_path = File.join File.expand_path(File.dirname(__FILE__)), 'lisp/boot.nydp'
118
- test_runner_path = File.join File.expand_path(File.dirname(__FILE__)), 'lisp/test-runner.nydp'
119
- tests = Dir.glob(File.join File.expand_path(File.dirname(__FILE__)), 'lisp/tests/**/*.nydp')
120
- StreamRunner.new(vm, root_ns, File.new(boot_path)).run
121
- StreamRunner.new(vm, root_ns, File.new(test_runner_path)).run
122
- tests.each do |tst|
123
- StreamRunner.new(vm, root_ns, File.new(tst)).run
124
- end
130
+ LOADFILES.each { |f| StreamRunner.new(vm, root_ns, File.new(f)).run }
125
131
  StreamRunner.new(vm, root_ns, "(run-all-tests)").run
126
132
  end
127
133
  end
@@ -0,0 +1,6 @@
1
+ namespace :nydp do
2
+ task :tests do
3
+ require 'nydp'
4
+ Nydp.tests
5
+ end
6
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nydp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conan Dalton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-29 00:00:00.000000000 Z
11
+ date: 2014-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,6 +134,7 @@ files:
134
134
  - lib/nydp/truth.rb
135
135
  - lib/nydp/version.rb
136
136
  - lib/nydp/vm.rb
137
+ - lib/tasks/tests.rake
137
138
  - nydp.gemspec
138
139
  - spec/boot_spec.rb
139
140
  - spec/embedded_spec.rb