tildeio / helix

Native Ruby extensions without fear
https://usehelix.com
ISC License
1.98k stars 60 forks source link

getting_started example not work well. #104

Open zw963 opened 7 years ago

zw963 commented 7 years ago

Following https://usehelix.com/getting_started, found some issues.

  1. rake irb only worked when into flipper/crates/text_transform/ directory. But, rake build is worked in flipper, so i think this is a issue

  2. default, Rails development use spring to boost rake, but not worked in flipper/crates/text_transform/

zw963 commented 7 years ago
 ╭─ 21:20  zw963 ⮀ ~/Project/rust/flipper ⮀ ⭠ (4c623dd) master ➦ ruby-2.3.4@flipper
 ╰─ $ rails --version
rRails 5.1.2

 ╭─ 21:20  zw963 ⮀ ~/Project/rust/flipper ⮀ ⭠ (4c623dd) master ➦ ruby-2.3.4@flipper
 ╰─ $ ruby --version
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux]

 ╭─ 21:20  zw963 ⮀ ~/Project/rust/flipper ⮀ ⭠ (4c623dd) master ➦ ruby-2.3.4@flipper
 ╰─ $ 127  rustc --version
rustc 1.18.0 (03fc9d622 2017-06-06)
zw963 commented 7 years ago

As we see, no rake irb task.

 ╭─ 21:22  zw963 ⮀ ~/Project/rust/flipper ⮀ ⭠ (4c623dd) master ➦ ruby-2.3.4@flipper
 ╰─ $ 2  rake -T |grep -i helix
rake build                              # Build Helix projects in crates
rake clobber                            # Clobber Helix builds in crates
zw963 commented 7 years ago
  1. Need add following code to make rspec work
+++ b/crates/text_transform/Rakefile
@@ -1,6 +1,7 @@
 require 'bundler/setup'
 import 'lib/tasks/helix_runtime.rake'

+require 'rspec/core/rake_task'
 RSpec::Core::RakeTask.new(:spec) do |t|
   t.verbose = false
 end
wagenet commented 7 years ago

Thanks for filing this issue!

  1. I think this is a documentation error. The rake irb task is intended for basic testing of individual crates so I think it's ok to have to change into the crate directory to run it. I'll update the guide.
  2. I'm not sure what you mean.
  3. The generated crate Rakefile doesn't have an RSpec task in it. I'm confused as to why you think we need to add the require. You'd have to go through these steps to add RSpec to any project, right?
wagenet commented 7 years ago

I've updated the website to correct the Getting Started Guide.

zw963 commented 7 years ago

I think this is a documentation error. The rake irb task is intended for basic testing of individual crates so I think it's ok to have to change into the crate directory to run it. I'll update the guide.

I see document update, thanks

  1. I'm not sure what you mean. What i means is: spring rake some:task not worked in flipper/crates/text_transform/. As you know, It worked prefect in filpper directory. anywhy, maybe this not a issue too?

The generated crate Rakefile doesn't have an RSpec task in it. I'm confused as to why you think we need to add the require. You'd have to go through these steps to add RSpec to any project, right?

What i means is Step 4: Adding a feature in document. following example is not worked.

require 'bundler/setup'
require 'rspec/core/rake_task'
import 'lib/tasks/helix_runtime.rake'

RSpec::Core::RakeTask.new(:spec) do |t|
  t.verbose = false
end

task :spec => :build
task :default => :spec

in my local machine, i have to add require 'rspec/core/rake_task' to make it rake command work.

I think exist one just not working example in this tutorial, should be fix.