Sha256: 36866408a67165720a3c16ef5e1c7e26bd85a5abd00a4f9da1b7c399a42e8ae9

Contents?: true

Size: 783 Bytes

Versions: 18

Compression:

Stored size: 783 Bytes

Contents

module Retreaver
  class Compile

    class << self
      def perform
        Dir.chdir(root) do |f|
          run("npm install") unless Dir.exist?('./node_modules')
          # compile src
          run("grunt")
          output = 'vendor/assets/javascripts/'
          FileUtils.rm_rf(output)
          FileUtils.mkdir_p(output)
          Dir.glob('dist/*.js') { |f| FileUtils.cp(f, output) }
          # generate jsdocs
          output = 'vendor/documentation/javascripts/'
          FileUtils.rm_rf(output)
          run("./node_modules/.bin/jsdoc -c config/jsdocs.json")
        end
      end

      def run(command)
        puts(command)
        system(command)
      end

      def root
        File.expand_path(File.join(__FILE__, '../../../'))
      end
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
retreaverjs-rails-0.2.16 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.15 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.14 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.13 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.12 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.11 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.10 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.9 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.8 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.7 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.6 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.5 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.4 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.3 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.2 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.1 lib/retreaverjs/compile.rb
retreaverjs-rails-0.2.0 lib/retreaverjs/compile.rb
retreaverjs-rails-0.1.0 lib/retreaverjs/compile.rb