square / fdoc

Documentation format and verification
Other
380 stars 59 forks source link

Recursive directory building and silence rspec 3 deprecation warning #60

Closed jasonayre closed 10 years ago

jasonayre commented 10 years ago

FDoc was breaking on my project due to namespaced controllers, as it wasnt able to create the folders for which the .fdoc generated files live in. This fixes that issue by using mkdir_p for recursive directory building.

Also RSpec3 was throwing this lovely deprecation warning:

RSpec::Core::ExampleGroup#example is deprecated and will be removed
in RSpec 3. There are a few options for what you can use instead:

  - rspec-core's DSL methods (`it`, `before`, `after`, `let`, `subject`, etc)
    now yield the example as a block argument, and that is the recommended
    way to access the current example from those contexts.
  - The current example is now exposed via `RSpec.current_example`,
    which is accessible from any context.
  - If you can't update the code at this call site (e.g. because it is in
    an extension gem), you can use this snippet to continue making this
    method available in RSpec 2.99 and RSpec 3:

      RSpec.configure do |c|
        c.expose_current_running_example_as :example
      end

(Called from /Users/jasonayre/.rvm/gems/ruby-2.1.1/gems/fdoc-0.3.2/lib/fdoc/spec_watcher.rb:39:in `path')

So took the liberty of fixing that as well.

zachmargolis commented 10 years ago

Looks great!

Have you signed the individual contributor license agreement?

jasonayre commented 10 years ago

I have now

christopherhein commented 10 years ago

:)