hubris 0.0.4 → 0.0.5

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.
@@ -169,9 +169,9 @@ instance Enum RubyConst where
169
169
  toEnum 12 = RUBY_Qnil
170
170
  -- {# enum ruby_special_consts as RubyConst {} deriving (Eq,Show) #}
171
171
 
172
- str2cstr str = rb_str2cstr str 0
172
+ -- str2cstr str = rb_str2cstr str
173
173
  type Value = CULong -- FIXME, we'd prefer to import the type VALUE directly
174
- foreign import ccall safe "ruby.h rb_str2cstr" rb_str2cstr :: Value -> CInt -> IO CString
174
+
175
175
  foreign import ccall safe "ruby.h rb_str_new2" rb_str_new2 :: CString -> IO Value
176
176
  foreign import ccall safe "ruby.h rb_str_new2" rb_str_new_ :: CString -> Int -> IO Value
177
177
  foreign import ccall safe "ruby.h rb_ary_new2" rb_ary_new2 :: CLong -> IO Value
@@ -186,7 +186,7 @@ rb_str_new = uncurry rb_str_new_
186
186
  -- we're being a bit filthy here - the interface is all macros, so we're digging in to find what it actually is
187
187
  foreign import ccall safe "rshim.h rb_ary_len" rb_ary_len :: Value -> CUInt
188
188
  foreign import ccall safe "rshim.h rtype" rtype :: Value -> Int
189
-
189
+ foreign import ccall safe "rshim.h str2cstr" str2cstr :: Value -> IO CString
190
190
  foreign import ccall safe "rshim.h int2fix" int2fix :: Int -> Value
191
191
  foreign import ccall safe "rshim.h fix2int" fix2int :: Value -> Int
192
192
  foreign import ccall safe "rshim.h num2dbl" num2dbl :: Value -> Double -- technically CDoubles, but jhc promises they're the same
@@ -44,3 +44,6 @@ VALUE buildException(char * message) {
44
44
  return errobj;
45
45
  }
46
46
 
47
+ char * str2cstr(VALUE v) {
48
+ StringValuePtr(v);
49
+ }
@@ -11,6 +11,7 @@ double num2dbl(VALUE x);
11
11
  unsigned int rb_ary_len(VALUE x);
12
12
  VALUE keys(VALUE hash);
13
13
  VALUE buildException(char *);
14
+ char * str2cstr(VALUE v);
14
15
  // argh, and again
15
16
  enum RubyType {
16
17
  RT_NONE = T_NONE,
@@ -1,3 +1,3 @@
1
1
  module Hubris
2
- VERSION='0.0.4'
2
+ VERSION='0.0.5'
3
3
  end
data/script/ci.sh CHANGED
@@ -14,9 +14,11 @@ cabal install zlib --user --enable-shared # needed for tests
14
14
  # delete old haskell stuff
15
15
  ghc-pkg-$ghc_version unregister hubris || true
16
16
  rm `which Hubrify` || true
17
- rvm 1.9.1
17
+ rvm $ruby_version
18
+ bundle
18
19
  gem build hubris.gemspec
19
20
  gem install hubris-0.0.4.gem # can we do these two in one step?
21
+ rspec spec
20
22
 
21
23
  #gem install bundler # i am aware how awful this is.
22
24
  #bundle install
data/spec/hubris_spec.rb CHANGED
@@ -385,9 +385,6 @@ describe 'Realworld' do
385
385
  end
386
386
 
387
387
  describe 'Performance' do
388
- def be_quick
389
- simple_matcher("a small duration") { |given| given < 0.1 }
390
- end
391
388
 
392
389
  it "caches its output" do
393
390
  # only relevant for inlining
@@ -401,7 +398,7 @@ describe 'Performance' do
401
398
  end
402
399
  after = Time.now
403
400
 
404
- (after-before).should be_quick
401
+ (after-before).should < 0.1
405
402
  end
406
403
 
407
404
  it "behaves memory-wise" do
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,11 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems' unless ENV['NO_RUBYGEMS']
5
- gem 'rspec'
6
- require 'spec'
7
- end
1
+ #begin
2
+ # require 'spec'
3
+ #rescue LoadError
4
+ # require 'rubygems' unless ENV['NO_RUBYGEMS']
5
+ # gem 'rspec'
6
+ # require 'spec'
7
+ #end
8
+ require 'rspec'
8
9
 
9
10
  $:.unshift(File.dirname(__FILE__) + '/../lib')
10
11
  require 'hubris'
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubris
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 4
10
- version: 0.0.4
4
+ prerelease:
5
+ version: 0.0.5
11
6
  platform: ruby
12
7
  authors:
13
8
  - Mark Wotton
@@ -17,7 +12,7 @@ autorequire:
17
12
  bindir: bin
18
13
  cert_chain: []
19
14
 
20
- date: 2011-02-24 00:00:00 +11:00
15
+ date: 2011-03-14 00:00:00 +11:00
21
16
  default_executable:
22
17
  dependencies:
23
18
  - !ruby/object:Gem::Dependency
@@ -28,11 +23,6 @@ dependencies:
28
23
  requirements:
29
24
  - - ">="
30
25
  - !ruby/object:Gem::Version
31
- hash: 15
32
- segments:
33
- - 0
34
- - 7
35
- - 6
36
26
  version: 0.7.6
37
27
  type: :runtime
38
28
  version_requirements: *id001
@@ -44,11 +34,6 @@ dependencies:
44
34
  requirements:
45
35
  - - "="
46
36
  - !ruby/object:Gem::Version
47
- hash: 31
48
- segments:
49
- - 2
50
- - 4
51
- - 0
52
37
  version: 2.4.0
53
38
  type: :development
54
39
  version_requirements: *id002
@@ -60,9 +45,6 @@ dependencies:
60
45
  requirements:
61
46
  - - ">="
62
47
  - !ruby/object:Gem::Version
63
- hash: 3
64
- segments:
65
- - 0
66
48
  version: "0"
67
49
  type: :runtime
68
50
  version_requirements: *id003
@@ -74,9 +56,6 @@ dependencies:
74
56
  requirements:
75
57
  - - ">="
76
58
  - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
59
  version: "0"
81
60
  type: :runtime
82
61
  version_requirements: *id004
@@ -91,7 +70,6 @@ extra_rdoc_files: []
91
70
 
92
71
  files:
93
72
  - .gitignore
94
- - .rvmrc
95
73
  - Gemfile
96
74
  - HISTORY.markdown
97
75
  - Haskell/Hubrify.hs
@@ -154,25 +132,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
132
  requirements:
155
133
  - - ">="
156
134
  - !ruby/object:Gem::Version
157
- hash: 3
158
- segments:
159
- - 0
160
135
  version: "0"
161
136
  required_rubygems_version: !ruby/object:Gem::Requirement
162
137
  none: false
163
138
  requirements:
164
139
  - - ">="
165
140
  - !ruby/object:Gem::Version
166
- hash: 3
167
- segments:
168
- - 0
169
141
  version: "0"
170
142
  requirements: []
171
143
 
172
144
  rubyforge_project: Hubris
173
- rubygems_version: 1.3.7
145
+ rubygems_version: 1.5.2
174
146
  signing_key:
175
147
  specification_version: 3
176
148
  summary: A bridge between Ruby and Haskell
177
- test_files: []
178
-
149
+ test_files:
150
+ - spec/hubris_spec.rb
151
+ - spec/spec.opts
152
+ - spec/spec_helper.rb
data/.rvmrc DELETED
@@ -1,2 +0,0 @@
1
- rvm_install_on_use_flag=1
2
- rvm 1.9.1