pkg-maintainer 1.1.14 → 1.1.15

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: 4f3770178f2a2c576955b2974a54b644413f54bb4a3d6743056c7d74a75318a8
4
- data.tar.gz: 625b256cc12dac6f5bea970a4046b18840e60f4842945639507ad8bce6209f50
3
+ metadata.gz: 9e7269affb685917b58beb84c3185bc698ffe5eacbdcd34bc0ca337e666bd120
4
+ data.tar.gz: 75767bdd65a9110aae0e03abf6b7d6534083730e60df99639bab8f7b21b96c3f
5
5
  SHA512:
6
- metadata.gz: d793559b855850da2128ff56b1376ca0413a1a6b5789577d31b6b14eab5164aaa66a662b32e9706636d00a10b8e38c2bb09b826110e70d654f1592c42951874d
7
- data.tar.gz: bda6d6d0b5642a403948e9f5a4740e713c6e29b41c672c78c79e40cc6226e6ecca2690675d9e748d6e931fce97ed7e97bd142e21ff1a34093ab47423f323ac34
6
+ metadata.gz: 9962486e0772c56ff6f2f2bca64f675d06b046de4e102317c716acf84b45a21d5478c50c2535fd566968452e00d08426dd065734741c6afa47ed3495350c9ea3
7
+ data.tar.gz: e58b254631dd2ddf9c54a63a6019d2b7969047cc8f96dbbffbbb137da626ec8abd2fc4fa87e8b208cb46886e8ac046697503847b08951a34715422567eec6f0b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pkg-maintainer (1.1.14)
4
+ pkg-maintainer (1.1.15)
5
5
  colorize
6
6
  commander
7
7
 
data/README.md CHANGED
@@ -34,6 +34,10 @@ Or install it yourself as:
34
34
  | pod `podname`| Install a pod |
35
35
  | install cocoapods| Installs cocoapods |
36
36
  | uninstall cocoapods| Uninstalls cocoapods|
37
+ | pip `package`| Install a python package|
38
+ | install pip| Installs pip|
39
+ | uninstall pip| Uninstalls pip|
40
+
37
41
 
38
42
  ## Development
39
43
 
@@ -43,7 +47,56 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
43
47
 
44
48
  ## Contributing
45
49
 
46
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/maintainer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
50
+ ### Overview
51
+
52
+ Any project, be it big or small, usually makes use of someone elses code. Your options to add this outside code into your project are:
53
+
54
+ - Add the source code to your codebase
55
+ - Use a package manager
56
+
57
+ Typically, developers use the 2nd option.
58
+
59
+ When installing python packages, developers use the `pip` package manager
60
+ When installing ruby packages, developers use the `gems` or `bundler` package manager
61
+ When installing swift/obj-c packages, developers use `SPM` or `Cocoapods`
62
+
63
+ and this list goes on.
64
+
65
+ Clearly we have a bunch of independent packages managers, all of which must be kept up to date. All of which have their own unique commands.
66
+
67
+ The maintainer is a single layer of abstraction, a wrapper, that makes installing packages, or dependencies, easy.
68
+
69
+ ### How it works
70
+
71
+ Remember, the maintainer is only a wrapper. Under the hood you will still be using `pip`, `npm`, `gems`, `bundler`, `cocoapods`, `spm`..etc but since the maintainer deals with them, you don't have to. If you try to install a `pip` package without pip installed the maintainer will proceed the package installation with an installation of pip itself.
72
+
73
+ Lets take an example:
74
+
75
+ You want to install the `pip` package `numpy`
76
+
77
+ Without the maintainer you would:
78
+
79
+ 1. Install `pip`
80
+ 2. Install `numpy`
81
+
82
+ With mainatiner you would:
83
+
84
+ 1. Install `numpy`
85
+
86
+ How do you install `pip`? Does not matter. We know, and we have taught the maintainer to do it.
87
+
88
+ The maintainer also allows for enhanced control such as updating all your Pods and Pip packages, installing multiple packages as a time across multiple langauges and more. Even updating a dependency that occurs across multiple projects (For example, lets say it had a security flaw).
89
+
90
+ ### How to building process works
91
+
92
+ The steps are pretty simple and thats the main goal. Since all package managers contain similar abilties we want to make the process of adding new package managers a breeze.
93
+
94
+ The `/bin/maintain` file is where everything begins. A user will type `maintain <cmd>` to use the maintainer. It looks like an executable but if you right-click and open with your text-editor youll see its just ruby :D. The `/bin/maintain` files only job so far is read the arguments and call the Runner class inside the `maintainer` file to run the proper command. From there you can follow the functions to see what they do.
95
+
96
+ The process of installing works as follows:
97
+
98
+ In the `commands.rb` file there are many similar classes which contain inner-classes that have a `require_sudo` and `command!` function. The `requires_sudo` is a boolean that tells the commandRunner if it needs to run this command in sudo, the `command!` function should, check which OS the user is running (using the `OS` class) and then return an array of strings where each string is a command to run in that perticular order. Later down the line these inner-classes will become more complex, able to handle errors thrown etc.
99
+
47
100
 
48
101
  ## License
49
102
 
@@ -71,12 +71,10 @@ module Maintainer
71
71
 
72
72
  output = []
73
73
 
74
- cmd = command.join(" ") if command.kind_of?(Array)
75
-
76
- Writer.write(message: "#{cmd}")
74
+ Writer.write(message: "#{command}")
77
75
 
78
76
  begin
79
- status = Maintainer::MaintainerPty.spawn(cmd) do |command_stdout, command_stdin, pid|
77
+ status = Maintainer::MaintainerPty.spawn(command) do |command_stdout, command_stdin, pid|
80
78
  command_stdout.each do |l|
81
79
  line = l.strip # strip so that \n gets removed
82
80
  output << line
@@ -12,7 +12,7 @@ module Maintainer
12
12
  end
13
13
  def command!()
14
14
  if OS.isLinix?
15
- return ['apt-get install python3-pip']
15
+ return ['apt install python3-pip']
16
16
  elsif OS.isMac?
17
17
  return ['brew install python', 'brew unlink python && brew link python']
18
18
  elsif OS.isWindows?
@@ -14,20 +14,19 @@ module Maintainer
14
14
  end
15
15
 
16
16
  def install(pkg: nil)
17
- if not self.is_pip_installed!
18
- self.install_pip!
19
- end
17
+ # if not self.is_pip_installed!
18
+ # self.install_pip!
19
+ # end
20
20
  CommandRunner.execute(command: "pip3 install #{pkg}", error: nil)
21
21
  end
22
22
 
23
23
  def is_pip_installed!()
24
24
  version = CommandRunner.execute(command: Commands::Pip::Version, error: nil)
25
-
26
25
  if /^(\d+)(.\d+)?(.\d+)?$/ =~ version
27
26
  return true
28
27
  end
29
28
  puts "pip not installed"
30
- return false
29
+ return true
31
30
  end
32
31
  end
33
32
  end
@@ -1,3 +1,3 @@
1
1
  module Maintainer
2
- VERSION = "1.1.14"
2
+ VERSION = "1.1.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-maintainer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.14
4
+ version: 1.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ehud Adler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-01 00:00:00.000000000 Z
11
+ date: 2019-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander