qwandry 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cb4515638417176bd87f5a830b8d065c9e0defb3
4
+ data.tar.gz: 74c448e77bc88a83327a10a8086e00608a98833f
5
+ SHA512:
6
+ metadata.gz: 30876fb340b2a1f9dbb607ba132415a1c602440253c427868a766b36cdc00d5172e3dc0b408a5bed409db900f64ba7a326bfe65bf458b09987bf87f39312eb31
7
+ data.tar.gz: c5d506e2983a32dc8853e99bdc3d1ec7cc69fa32b453f8a4966aa2658613a49cb93d0765d17160349a693d0ed70a422a1ef889887220587387716a9cbf8cf87c
@@ -4,16 +4,16 @@ Qwandry, a questionable tool
4
4
  Why spend time trying to remember where libraries, projects, and packages are
5
5
  lurking when your computer can do it faster?
6
6
 
7
- qw matrix # opens ruby's matrix class in your editor
8
- qw rails # will ask you which version of rails you want to open
9
- qw activerec 3.1 # will find the gem activerecord 3.1 and open it
10
-
7
+ qw matrix # opens ruby's matrix class in your editor
8
+ qw rails # will ask you which version of rails you want to open
9
+ qw activerec 3.1 # will find the gem activerecord 3.1 and open it
10
+
11
11
  You can also use Qwandry with other common languages:
12
12
 
13
13
  qw -r python numpy # opens python's numpy library
14
14
  qw -r perl URI # open perl's URI library
15
15
  qw -r node express # open express if it is installed for node
16
-
16
+
17
17
  Installation
18
18
  ------------
19
19
  Qwandry is a standard ruby gem, on any system with ruby installed already
@@ -31,9 +31,23 @@ default Qwandry is set up for locating and editing ruby libraries.
31
31
  Want to use Qwandry with Python, Perl, or other languages?
32
32
 
33
33
  qw --customize
34
+
35
+ Editor Selection
36
+ ----------------
37
+
38
+ Qwandry uses environment variables to launch your configured editor. The
39
+ following env variables are checked, in this order. The first value found is
40
+ used.
41
+
42
+ QWANDRY_EDITOR
43
+ VISUAL
44
+ EDITOR
45
+
46
+ Setting `QWANDRY_EDITOR` allows you to specify an editor to be used with
47
+ Qwandry only.
34
48
 
35
49
  Contact
36
50
  -------
37
51
  Adam Sanderson, netghost@gmail.com
38
52
 
39
- Issues and Source: https://github.com/adamsanderson/qwandry
53
+ Issues and Source: https://github.com/adamsanderson/qwandry
data/bin/qw CHANGED
@@ -26,6 +26,10 @@ opts = OptionParser.new do |opts|
26
26
  @launcher.editor = editor
27
27
  end
28
28
 
29
+ opts.on("-s", "--show", "Show package path") do |editor|
30
+ @launcher.editor = "echo"
31
+ end
32
+
29
33
  opts.separator "Additional Commands"
30
34
 
31
35
  opts.on("--customize", "Create and edit files for customizing Qwandry") do
@@ -41,11 +41,24 @@ end
41
41
 
42
42
  # Add node.js repositories:
43
43
  register_if_present :node do
44
- # Execute a node script to find all of the load paths:
45
- node_script_path = File.join(File.dirname(__FILE__),'probe_node.js')
46
- node_paths = `node #{node_script_path}` rescue ''
47
44
 
48
- node_paths = node_paths.split("\n")
45
+ node_paths = []
46
+
47
+ # check all parent folders for node_modules
48
+ i = 0
49
+ while true
50
+ parent_path = File.expand_path './' + '../' * i
51
+ test_path = parent_path + '/node_modules'
52
+ if File.directory? test_path
53
+ node_paths.push test_path
54
+ end
55
+ break if parent_path == '/' # expand_path keeps returning '/', rather than an error, if you have too many ../'s
56
+ i += 1
57
+ end
58
+
59
+ # require.paths is removed, so we use NODE_PATH instead to get the global paths
60
+ node_paths.concat ENV['NODE_PATH'].split(':')
61
+
49
62
  # Add the node paths
50
63
  add node_paths
51
64
  end
@@ -28,8 +28,13 @@ module Qwandry
28
28
  editor ||= @editor || ENV['QWANDRY_EDITOR'] || ENV['VISUAL'] || ENV['EDITOR']
29
29
 
30
30
  if (!editor) || (editor =~ /^\s*$/) # if the editor is not set, or is blank, exit with a message:
31
- puts "Please set QWANDRY_EDITOR, VISUAL or EDITOR, or pass in an editor to use"
32
- exit 1
31
+ puts "Please set QWANDRY_EDITOR, VISUAL or EDITOR, or pass in an editor to use (-e editor)"
32
+ if STDOUT.tty?
33
+ print "Or, select an editor now: "
34
+ editor = gets
35
+ else
36
+ exit 1
37
+ end
33
38
  end
34
39
 
35
40
  paths = package.is_a?(String) ? [package] : package.paths
metadata CHANGED
@@ -1,77 +1,58 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: qwandry
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 5
9
- version: 0.1.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.6
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Adam Sanderson
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2013-01-06 00:00:00 -08:00
18
- default_executable: qw
11
+ date: 2013-01-06 00:00:00.000000000 Z
19
12
  dependencies: []
20
-
21
13
  description: Open a gem or library's source directory with your default editor.
22
14
  email: netghost@gmail.com
23
- executables:
15
+ executables:
24
16
  - qw
25
17
  extensions: []
26
-
27
- extra_rdoc_files:
18
+ extra_rdoc_files:
28
19
  - README.markdown
29
- files:
20
+ files:
21
+ - README.markdown
22
+ - Rakefile
30
23
  - bin/qw
31
- - lib/qwandry/configuration/default.rb
32
- - lib/qwandry/configuration/probe_node.js
24
+ - lib/qwandry.rb
33
25
  - lib/qwandry/configuration.rb
26
+ - lib/qwandry/configuration/default.rb
34
27
  - lib/qwandry/flat_repository.rb
35
28
  - lib/qwandry/launcher.rb
36
29
  - lib/qwandry/library_repository.rb
37
30
  - lib/qwandry/package.rb
38
31
  - lib/qwandry/repository.rb
39
- - lib/qwandry.rb
40
- - templates/init.rb
41
32
  - templates/README
42
- - Rakefile
43
- - README.markdown
44
- has_rdoc: true
33
+ - templates/init.rb
45
34
  homepage: http://github.com/adamsanderson/qwandry
46
35
  licenses: []
47
-
36
+ metadata: {}
48
37
  post_install_message:
49
- rdoc_options:
50
- - --charset=UTF-8
51
- require_paths:
38
+ rdoc_options:
39
+ - "--charset=UTF-8"
40
+ require_paths:
52
41
  - lib
53
- required_ruby_version: !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
56
44
  - - ">="
57
- - !ruby/object:Gem::Version
58
- segments:
59
- - 0
60
- version: "0"
61
- required_rubygems_version: !ruby/object:Gem::Requirement
62
- none: false
63
- requirements:
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
64
49
  - - ">="
65
- - !ruby/object:Gem::Version
66
- segments:
67
- - 0
68
- version: "0"
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
69
52
  requirements: []
70
-
71
53
  rubyforge_project:
72
- rubygems_version: 1.3.7
54
+ rubygems_version: 2.4.6
73
55
  signing_key:
74
- specification_version: 3
56
+ specification_version: 4
75
57
  summary: Qwandry lets you quickly edit ruby gems and libraries
76
58
  test_files: []
77
-
@@ -1,4 +0,0 @@
1
- // If anyone knows a way to pipe a one liner into node to do this,
2
- // I'm all ears.
3
- var sys = require('sys')
4
- sys.puts(require.paths.join("\n"))