Skip to content

Commit

Permalink
Fix loading of binary lib in bundler envs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianks committed Mar 3, 2017
1 parent fdbc99c commit 851c3b1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fast_woothee"
version = "1.0.2"
version = "1.0.3"
authors = ["Ian Ker-Seymer <[email protected]>"]
repository = "https://github.com/ianks/fast_woothee"
publish = false
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ performant, and safe user-agent parsing.

## Installation

Add this line to your application's Gemfile:
Having Rust/Cargo installed is _optional_. If it is not installed, the gem will
download the libs binary automatically. Simply add this line to your
application's Gemfile:

```ruby
gem 'fast_woothee'
Expand Down
2 changes: 1 addition & 1 deletion fast_woothee.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = "fast_woothee"
spec.version = "1.0.2"
spec.version = "1.0.3"
spec.authors = ["Ian Ker-Seymer"]
spec.email = ["[email protected]"]

Expand Down
6 changes: 4 additions & 2 deletions lib/fast_woothee.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true
require 'thermite/fiddle'

gem_root = File.dirname(File.dirname(__FILE__))

Thermite::Fiddle.load_module 'initialize_fast_woothee',
cargo_project_path: '.',
ruby_project_path: '.'
cargo_project_path: gem_root,
ruby_project_path: gem_root
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ methods!(
#[no_mangle]
pub extern fn initialize_fast_woothee() {
Class::new("FastWoothee", None).define(|itself| {
itself.const_set("VERSION", &RString::new("1.0.2").freeze());
itself.const_set("VERSION", &RString::new("1.0.3").freeze());
itself.def_self("parse", parse);
itself.def_self("crawler?", crawler);
});
Expand Down

0 comments on commit 851c3b1

Please sign in to comment.