pry-doc 0.13.1 → 0.13.2pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16c87fe7047dc0c805afb00d2b5455a00cf4c2859c7be55f2584df235ebd8905
4
- data.tar.gz: be6568087a5e785cb3dc205e752196d9c9a735de2c533b3b583de84afad085eb
3
+ metadata.gz: e8f4ae3ef5f53179eda1d6c5ef228b3e31fe8528337b341e2265d5bd50eda4eb
4
+ data.tar.gz: df9ae2c12799e36e892057d0f10c3b9d1f44483cd22631f8469cdd6918457a22
5
5
  SHA512:
6
- metadata.gz: 17eacd691384632a56f433008c0f2b7bd2e72546e9724ed1ef9b861c1f287c988f4b2dd748ef4342a6003963155d11ea9fe951ffad702016704656190276bea7
7
- data.tar.gz: ed20c5e955d56fe26ba76030d4fb332744726d4816bbfc546c171e1813e1bb5940be1996efd4e27118f1f908e4d90a4ea00ec715814f1fc3215d4fa328ca7210
6
+ metadata.gz: 0206b39bb7df0e15bba7c6282ff8d8a85035e5b25794f7c2ac59e640d8b79ff0814fd64670342ca52db0171dc3a7efcaee6586384f87e6913cbace846a1c414a
7
+ data.tar.gz: 6412205ed92ddd525824fd348bc5bf04cb82fec8126492c72faff5a3ea490558da8c0d1d07a6030360f23429fe3b4d9437f993fd4bfbae11763d57a69f641303
@@ -36,10 +36,19 @@ module Pry::CInternals
36
36
  private
37
37
 
38
38
  def source_location_for(symbol, line_number)
39
- SourceLocation.new(File.join(ruby_source_folder, @file_name),
39
+ SourceLocation.new(full_path_for(@file_name),
40
40
  cleanup_linenumber(line_number), symbol_type_for(symbol.strip))
41
41
  end
42
42
 
43
+ def full_path_for(file_name)
44
+ if RbConfig::CONFIG['host'] =~ /mswin|mingw/
45
+ # windows etags already has the path expanded, wtf
46
+ file_name
47
+ else
48
+ File.join(ruby_source_folder, @file_name)
49
+ end
50
+ end
51
+
43
52
  def symbol_type_for(symbol)
44
53
  if symbol =~ /#\s*define/
45
54
  :macro
@@ -113,9 +113,13 @@ module Pry::CInternals
113
113
  puts "...Finished!"
114
114
  end
115
115
 
116
+ # for windows support need to:
117
+ # (1) curl -k --fail -L https://github.com/ruby/ruby/archive/v2_4_1.zip
118
+ # need -k as insecure as don't have root certs
119
+ # (2) 7z x v2_4_1.zip to extract it (via 7zip, choco install 7zip)
120
+ # (3) generate etags with: dir /b /s *.c *.h *.y | etags - --no-members
121
+ # (4) Done!
116
122
  def self.download_ruby
117
- curl_cmd = "curl --fail -L https://github.com/ruby/ruby/archive/v#{ruby_version}.tar.gz | tar xzvf - 2> /dev/null"
118
-
119
123
  FileUtils.mkdir_p(ruby_source_folder)
120
124
  FileUtils.cd(File.dirname(ruby_source_folder)) do
121
125
  %x{ #{curl_cmd} }
@@ -123,22 +127,41 @@ module Pry::CInternals
123
127
  end
124
128
  end
125
129
 
130
+ def self.curl_cmd
131
+ if Pry::Platform.windows?
132
+ %{
133
+ curl -k --fail -L https://github.com/ruby/ruby/archive/v#{ruby_version}.zip
134
+ 7z -y x #{ruby_version}.zip
135
+ }
136
+ else
137
+ "curl --fail -L https://github.com/ruby/ruby/archive/v#{ruby_version}.tar.gz | tar xzvf - 2> /dev/null"
138
+ end
139
+ end
140
+
126
141
  def self.etag_binary
127
- @etag_binary ||= if RbConfig::CONFIG['host_os'] =~ /linux/
142
+ @etag_binary ||= if Pry::Platform.linux?
128
143
  arch = RbConfig::CONFIG['arch'] =~ /i(3|6)86/ ? 32 : 64
129
144
  File.join(PryDoc.root, "libexec/linux/etags-#{arch}")
145
+ elsif Pry::Platform.windows?
146
+ File.join(PryDoc.root, "libexec/windows/etags")
130
147
  else
131
148
  "etags"
132
149
  end
133
150
  end
134
151
 
135
- def self.generate_tagfile
136
- find_cmd = "find . -type f -name '*.[chy]' | #{etag_binary} - --no-members"
152
+ def self.etag_cmd
153
+ if Pry::Platform.windows?
154
+ "dir /b /s *.c *.h *.y | #{etag_binary} - --no-members"
155
+ else
156
+ "find . -type f -name '*.[chy]' | #{etag_binary} - --no-members"
157
+ end
158
+ end
137
159
 
160
+ def self.generate_tagfile
138
161
  FileUtils.cd(ruby_source_folder) do
139
162
  puts "Generating tagfile!"
140
- %x{ #{find_cmd} }
141
- check_for_error(find_cmd) { File.size(File.join(ruby_source_folder, "TAGS")) > 500 }
163
+ %x{ #{etag_cmd} }
164
+ check_for_error(etag_cmd) { File.size(File.join(ruby_source_folder, "TAGS")) > 500 }
142
165
  end
143
166
  end
144
167
  end
@@ -1,3 +1,3 @@
1
1
  module PryDoc
2
- VERSION = '0.13.1'
2
+ VERSION = '0.13.2pre1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-16 00:00:00.000000000 Z
11
+ date: 2018-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -160,9 +160,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
160
  version: '2.0'
161
161
  required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  requirements:
163
- - - ">="
163
+ - - ">"
164
164
  - !ruby/object:Gem::Version
165
- version: '0'
165
+ version: 1.3.1
166
166
  requirements: []
167
167
  rubyforge_project:
168
168
  rubygems_version: 2.7.3