Commit Graph

353 Commits

Author SHA1 Message Date
Peter Wagenet 1880ece06b Looser version requirement for Thor
This matches how Rails does it.
2017-10-10 16:17:20 -07:00
Peter Wagenet 48f0349ba1 Add descriptions for base Rake tasks 2017-10-10 16:17:05 -07:00
Peter Wagenet 17b0fbb15b Don't lock Gemfiles 2017-10-10 16:16:48 -07:00
Godfrey Chan 263ddf9937 Remove unused cslice dependency 2017-10-09 23:35:10 -07:00
Godfrey Chan f4dcbf6ea1 v0.7.2 2017-10-09 22:53:01 -07:00
Godfrey Chan 0d94bf2bb2 Add json_builder to CI 2017-10-09 22:40:47 -07:00
Godfrey Chan c485529059 Merge pull request #128 from tildeio/consume-self
Allow consuming self in methods
2017-10-09 22:18:30 -07:00
Godfrey Chan 08cbc9416b Merge pull request #127 from tildeio/symbol
Add Symbol coercion
2017-10-09 22:18:18 -07:00
Godfrey Chan 3adc5fd5b7 Allow consuming self in methods
Using the object (calling Rust methods from Ruby) after consuming
would raise a RuntimeError.

Also fixes some parser bugs that previously allowed invalid syntax
through in the arguments position.
2017-10-09 11:20:42 -07:00
Godfrey Chan 0cdd075c22 Add Symbol coercion
The main use case for symbols is to use them as a HashMap key. However,
this introduces a GC problem – we cannot store Ruby values in the heap
without properly marking/registering them, otherwise they might get
GC'ed by Ruby unexpectedly. (In fact, this is already a problem if you
have a `Vec<VALUE>`.)

I tried to avoid introducing additional problems by pinning down any
symbols that goes thought the coercion protocol. This is probably
overly aggressive, as it would cause any dynamic symbols (e.g.
`String#to_sym`) to become un-GC-able. We can revisit this once we
have a more general-purpose system to encode pinning semantics in
the type system.
2017-10-07 19:29:33 -07:00
Godfrey Chan 65a98c65d1 v0.7.1 2017-10-06 15:51:12 -07:00
Godfrey Chan 8380713764 Merge pull request #126 from tildeio/hone-array-coercions
Array coercions (actually rebased)
2017-10-06 15:46:27 -07:00
Godfrey Chan 5ce16e9550 Add hash <-> HashMap coercion 2017-10-06 14:54:11 -07:00
Godfrey Chan ff2a9d2a59 Add slice -> Ruby array 2017-10-05 10:47:42 -07:00
Godfrey Chan f584a08f5b Some coercion house-keeping 2017-10-05 09:58:42 -07:00
Godfrey Chan 385c9f1441 Port membership example to use new vec coercion 2017-10-05 09:52:27 -07:00
Godfrey Chan 259b556943 Improve error message 2017-10-05 09:44:48 -07:00
Godfrey Chan dac16373ae Rename to match Rust types 2017-10-05 09:37:45 -07:00
Peter Wagenet ce8f4430bc
Add Array coercions 2017-10-05 00:12:42 -05:00
Terence Lee 73d3258405
update examples lockfiles 2017-10-05 00:12:25 -05:00
Terence Lee aec4d726e1
implement fmt::Display for Error 2017-10-05 00:11:19 -05:00
Godfrey Chan 37b2f2f3e9 v0.7.0 2017-10-03 19:30:50 -05:00
mortyccp e2cf3df819 Fix incorrect native_lib name format bug
For project name with more then one '-' using `sub` will only replace
the first occurence. This cause `copy_native` to be failed due to
`File.exist?` check failed. Use `gsub` instead to fix.
2017-09-28 20:17:12 -07:00
Godfrey Chan e6bcbec37b Merge pull request #122 from tildeio/from_ruby
change UncheckedValue::to_checked to FromRuby::from_ruby
2017-09-26 22:45:03 -04:00
Godfrey Chan d0a4460dbb Don't panic! 2017-09-26 21:42:02 -04:00
Godfrey Chan cfdf0ce1ea Refactor `FromRuby`
- Make `Checked` an associated type. This allows `from_ruby` to carry
  over additional information (useful for `Option` etc)

- Move `ToRust` into `FromRuby` to ensure both get implemented together
2017-09-26 21:36:28 -04:00
Godfrey Chan d9ace88cc9 Remove unused UncheckedValue 2017-09-26 16:40:13 -04:00
Godfrey Chan 44c790244a Fix membership test 2017-09-26 16:37:37 -04:00
Terence Lee 6d3675c0f8 change UncheckedValue::to_checked to FromRuby::from_ruby
This allows helix gems to create type coercions
2017-09-26 16:35:02 -04:00
Godfrey Chan b9f090ed28 Cleanup downcast code 2017-09-26 14:27:39 -04:00
Godfrey Chan 9b638ac151 Test new error macros 2017-09-26 12:52:26 -04:00
Godfrey Chan 144157c064 [WIP] Exceptions cleanup 2017-09-26 11:03:39 -04:00
Godfrey Chan 7ea173ca0a Merge pull request #120 from kivikakk/tomlrb
Use 'tomlrb' instead of 'toml' gem
2017-09-21 23:10:54 +09:00
Ashe Connor 41064303ef
Use 'tomlrb' instead of 'toml' gem 2017-09-21 12:38:04 +10:00
Godfrey Chan ab7ba71b6a Allow `to_ruby` to fail
This switches the `to_ruby` trait method to return a `Result`, which
allows the coercion to fail.

The most obvious use case for this is to implement coercion for the
`Result` type in Rust (included in this PR), but there could be other
reasons why a coercion might fail. For example, if we were to implement
a coercion between a Rust and Ruby regular expression, the coercion
could fail if the Rust regular expression uses some Rust-specific
features that are not supported by the Ruby regular expression
implementation.
2017-09-20 18:50:09 +09:00
Yehuda Katz 21c6e00802 Merge pull request #118 from tildeio/compile_error
Use `compile_errors!` to report parse errors
2017-09-13 10:01:45 -07:00
Godfrey Chan 58d8da10f2 Use `compile_errors!` to report parse errors
Unfortunately, we will lose the span for these errors.

(See rust-lang/rust#44535)
2017-09-13 02:50:56 -07:00
Yehuda Katz afb61e9113 Merge pull request #117 from tildeio/ruby-name-for-classes
Ruby name for classes
2017-09-11 12:34:11 -07:00
Godfrey Chan f64727dbea Support #[ruby_name] remapping for classes 2017-09-11 02:01:02 -07:00
Godfrey Chan eeb4d56b08 Remove outdated/incorrect expansion rule in parser
Class names are not passed as meta in the AST, so this rule
wouldn't have matched anything.
2017-09-11 01:39:26 -07:00
Godfrey Chan 856244698f Use cstr-macro crate 2017-09-11 00:57:44 -07:00
Terence Lee 2864f15db3
v0.6.4 2017-09-05 17:03:37 -05:00
Terence Lee 4ff13d2426 Merge pull request #115 from hone/fix_32bit_windows_lib
Need to use the right dlltool for the respective arch
2017-09-05 16:40:14 -05:00
Terence Lee f38bbdbf60
Need to use the right dlltool for the respective arch
Apparently, `-m` still includes some 64 bit objects when running
dlltool. It leads to a linking error when compiling on 32-bit windows:

```
helix-runtime-0-6-3.i386.lib(dnekh.o) : fatal error LNK1112: module
machine type 'x64' conflicts with target machine type 'X86'
```

When analyzing the 32-bit lib file, you can see the 64-bit objects.

```
$ objdump -f helix-runtime-0-6-2.i386.lib
In archive helix-runtime-0-6-2.i386.lib:

dfrzt.o:     file format pe-x86-64
architecture: i386:x86-64, flags 0x00000038:
HAS_DEBUG, HAS_SYMS, HAS_LOCALS
start address 0x0000000000000000

dfrzh.o:     file format pe-x86-64
architecture: i386:x86-64, flags 0x00000039:
HAS_RELOC, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
start address 0x0000000000000000

dfrzs00056.o:     file format pe-i386
architecture: i386, flags 0x00000039:
HAS_RELOC, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
start address 0x00000000
```

This fix ensures we only run the 32-bit dlltool when building the 32-bit
native lib file
2017-08-31 20:33:53 -05:00
Godfrey Chan 5e5f2d9f70 v0.6.3 2017-08-30 21:37:09 -07:00
Godfrey Chan cabd43758f Merge pull request #114 from hone/fix_missing_lib_files
Fix missing .lib files when building libcruby-sys
2017-08-31 00:33:35 -04:00
Terence Lee 96dc384f0e
Fix missing .lib files when building libcruby-sys
There is a bug in Cargo, where .gitignore will override the include
directive in Cargo.toml. Since the .gitignore included .lib, the
helix-runtime-*.x86_64.lib and helix-runtime-*.i386.lib weren't being
packaged.
2017-08-30 22:55:51 -05:00
Godfrey Chan e43599a1bf v0.6.2 2017-08-28 23:10:49 -07:00
Godfrey Chan e47b390d97 Deprecate passing project name to `BuildTask`
Since we already have the `Cargo.toml`, we don't actually need the
user to pass the project name. Further more, the build task doesn't
actually work correctly if you pass any name _other than_ what is
in your `Cargo.toml` (as seen in #92).

Fixes #110.
2017-08-28 23:09:11 -07:00
Peter Wagenet 44be98056e Fix generator bundling 2017-07-21 10:31:58 -07:00