File tree 3 files changed +39
-8
lines changed
3 files changed +39
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Installs OS-specific packages required to run your gems.
4
4
5
+ Inspired by [ Natives] ( https://github.com/teohm/natives ) gem by @teohm .
6
+
7
+ Native anonymously communicates with a remote server to determine the required
8
+ native dependencies for your gems. No data is sent or collected without your
9
+ approval.
10
+
5
11
## Installation
6
12
7
13
Add this line to your application's Gemfile:
@@ -20,7 +26,9 @@ Or install it yourself as:
20
26
21
27
## Usage
22
28
23
- Run ` native ` before ` bundle install ` .
29
+ Before running ` bundle install ` , Run:
30
+
31
+ $ native
24
32
25
33
## Development
26
34
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
2
3
- require 'bundler/setup'
4
- require 'native'
3
+ $LOAD_PATH. unshift ( File . join ( File . dirname ( __FILE__ ) , '..' , 'lib' ) )
5
4
6
- file = 'Gemfile.lock'
7
- lockfile = Bundler ::LockfileParser . new ( Bundler . read_file ( file ) )
8
- platform = Native ::Platform . new
9
- puts "Detected OS: #{ platform . name } #{ platform . version } "
10
- puts lockfile . specs . map ( &:name )
5
+ require 'native/cli'
6
+
7
+ Native ::Cli . start
Original file line number Diff line number Diff line change
1
+ require 'thor'
2
+ require 'native'
3
+ require 'bundler'
4
+
5
+ module Native
6
+ # Command Line Interface
7
+ class Cli < Thor
8
+ desc 'list' , 'list native packages required by the catalog entries'
9
+ method_option :file , default : 'Gemfile.lock' , desc : 'dependency file'
10
+ def list ( file )
11
+ lockfile = ::Bundler ::LockfileParser . new ( Bundler . read_file ( file ) )
12
+ puts lockfile . specs . map ( &:name )
13
+ end
14
+
15
+ desc 'detect' , 'detect and print platform and package provider information'
16
+ def detect
17
+ platform = Native ::Platform . new
18
+ puts "Detected OS: #{ platform . inspect } #{ platform . version } "
19
+ end
20
+
21
+ desc 'version' , 'print version information'
22
+ def version
23
+ puts "Native version #{ VERSION } "
24
+ end
25
+ end
26
+ end
You can’t perform that action at this time.
0 commit comments