Hokkaido 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in Hokkaido.gemspec
4
- gemspec
5
-
6
- #gem 'pry'
4
+ gemspec
@@ -25,7 +25,6 @@ HEREDOC
25
25
 
26
26
  def test
27
27
  mocklib = File.expand_path('lib/motion_mock.rb')
28
- puts mocklib
29
28
  system("/usr/bin/env ruby -r #{mocklib} #{@true_path}")
30
29
  end
31
30
 
@@ -1,3 +1,3 @@
1
1
  module Hokkaido
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -2,6 +2,8 @@ require 'ruby_parser'
2
2
  require 'fileutils'
3
3
  require 'tempfile'
4
4
 
5
+ require 'pry'
6
+
5
7
  # require removal only
6
8
 
7
9
  class File
@@ -82,6 +84,33 @@ module Hokkaido
82
84
  # comment it out
83
85
  current_file += "# #{line}"
84
86
  next
87
+ elsif line.strip =~ /^autoload/
88
+ # same as require
89
+ parser = RubyParser.new
90
+ sexp = parser.parse(line)
91
+ call = sexp[2]
92
+
93
+ unless call == :autoload
94
+ # WEIRD SHIT IS HAPPENING
95
+ current_file += line
96
+ next
97
+ end
98
+
99
+ require_type = sexp[3][2][0]
100
+ library = sexp[3][2][1]
101
+
102
+ full_rb_path = File.join([@lib_folder, "#{library}.rb"])
103
+ unless @require_libs.include?(full_rb_path)
104
+ file_index = @require_libs.index(init_lib)
105
+ insert_index = file_index
106
+ @require_libs.insert insert_index, full_rb_path
107
+ parse_gem(full_rb_path)
108
+ end
109
+ # comment it out
110
+ current_file += "# #{line}"
111
+ next
112
+
113
+ #binding.pry
85
114
  elsif line.strip =~ /^eval/
86
115
  # comment it out
87
116
  current_file += "# FIXME: #eval is not available in motion\n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Hokkaido
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: