pandora-frameworks 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +16 -4
- data/AUTHORS +5 -0
- data/Gemfile +0 -1
- data/README.md +7 -5
- data/lib/pandora/commands/create.rb +13 -10
- data/lib/pandora/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34703383760159fc6bb1b0aefff0d74f875bfb07
|
4
|
+
data.tar.gz: 38961102af85ec0245b7ebf1e7011476999989ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ccded976522fea71eb29131801051f189a9d9a2c691216c7568e2ba97450bf4f7405d7abfd67c5f4b14eaf864d3b8edd2204043a7e2b963573c69851fc4693f
|
7
|
+
data.tar.gz: bceb733582f06812968f8ec0ca8a6f1e8937e680f392f536188a84184f9b09f6b6ef5d0c009832d00a5aa2bf4569ef85b297ff21a653b64ccfcf7dc3faba8cd4
|
data/.travis.yml
CHANGED
@@ -1,5 +1,17 @@
|
|
1
|
+
osx_image: xcode8
|
1
2
|
sudo: false
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
notifications:
|
4
|
+
email: false
|
5
|
+
language: objective-c
|
6
|
+
service_name: travis-pro
|
7
|
+
repo_token: 9u4s2QLGYCvlB15SAqThI9eSY732ypUFz
|
8
|
+
before_install:
|
9
|
+
gem install bundler;
|
10
|
+
bundle install;
|
11
|
+
script:
|
12
|
+
bundle exec rake;
|
13
|
+
bundle exec exe/pandora create Cua org.test;
|
14
|
+
cd Cua;
|
15
|
+
make build;
|
16
|
+
make spec;
|
17
|
+
|
data/AUTHORS
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|

|
2
2
|
|
3
3
|
[](https://travis-ci.org/frameworkoriented/pandora)
|
4
|
+
[](https://coveralls.io/github/frameworkoriented/pandora)
|
5
|
+
[](https://badge.fury.io/rb/pandora-frameworks)
|
6
|
+
[](http://www.rubydoc.info/github/framework-oriented/pandora/master)
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
TODO: Delete this and the text above, and describe your gem
|
8
|
+
Pandora is a command line tool written in Ruby thought to make working with Frameworks easier.
|
9
|
+
If you haven't heard about it before, we recommend you to check out [frameworkoriented.io](frameworkoriented.io)
|
8
10
|
|
9
11
|
## Installation
|
10
12
|
|
@@ -29,7 +31,7 @@ Or install it yourself as:
|
|
29
31
|
You can easily create a framework with the create command. It creates a framework project that includes an example project and an example playground:
|
30
32
|
|
31
33
|
```bash
|
32
|
-
pandora create NAME
|
34
|
+
pandora create NAME ORGANIZATION
|
33
35
|
```
|
34
36
|
|
35
37
|

|
@@ -42,7 +44,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
42
44
|
|
43
45
|
## Contributing
|
44
46
|
|
45
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
47
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/frameworkoriented/pandora. 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.
|
46
48
|
|
47
49
|
|
48
50
|
## License
|
@@ -12,12 +12,16 @@ module Pandora
|
|
12
12
|
# @param [String] directory where the framework will be created.
|
13
13
|
# @param [String] framework name.
|
14
14
|
# @param [String] framework organization.
|
15
|
+
# @param [Bool] open the project once the command finishes.
|
16
|
+
# @param [Bool] verbose.
|
15
17
|
# @return [Create] initialized command.
|
16
|
-
def initialize(path, name, organization)
|
18
|
+
def initialize(path, name, organization, open_when_completed = false, verbose = true)
|
17
19
|
@path = path
|
18
20
|
@name = name
|
19
21
|
@organization = organization
|
20
22
|
@url = "https://github.com/frameworkoriented/template/archive/master.zip"
|
23
|
+
@open_when_completed = open_when_completed
|
24
|
+
@verbose = verbose
|
21
25
|
end
|
22
26
|
|
23
27
|
# Executes the command
|
@@ -26,25 +30,24 @@ module Pandora
|
|
26
30
|
self.unzip_template
|
27
31
|
self.rename_files(self.framework_path)
|
28
32
|
self.rename_files_content
|
29
|
-
puts "Enjoy #{@name} FRAMEWORK! #yatusabes".colorize(:light_yellow)
|
30
|
-
system "
|
31
|
-
system "open #{project_path}"
|
33
|
+
puts "Enjoy #{@name} FRAMEWORK! #yatusabes".colorize(:light_yellow) if @verbose
|
34
|
+
system "open #{project_path}" if @open_when_completed
|
32
35
|
end
|
33
36
|
|
34
37
|
protected
|
35
38
|
|
36
39
|
def download_template
|
37
|
-
puts "=> Downloading framework template".colorize(:green)
|
40
|
+
puts "=> Downloading framework template".colorize(:green) if @verbose
|
38
41
|
response = RestClient.get(@url)
|
39
42
|
File.delete(self.zip_path) if File.exist?(self.zip_path)
|
40
43
|
zip_file = File.new(self.zip_path, "wb")
|
41
44
|
zip_file << response.body
|
42
45
|
zip_file.close
|
43
|
-
puts "=> Framework template downloaded".colorize(:green)
|
46
|
+
puts "=> Framework template downloaded".colorize(:green) if @verbose
|
44
47
|
end
|
45
48
|
|
46
49
|
def unzip_template
|
47
|
-
puts "=> Uncompressing template".colorize(:green)
|
50
|
+
puts "=> Uncompressing template".colorize(:green) if @verbose
|
48
51
|
Zip::File.open(self.zip_path) do |zip_file|
|
49
52
|
zip_file.each do |f|
|
50
53
|
fpath = File.join(@path, f.name)
|
@@ -54,7 +57,7 @@ module Pandora
|
|
54
57
|
FileUtils.remove(self.zip_path) if File.exist?(self.zip_path)
|
55
58
|
FileUtils.remove_dir self.framework_path if File.exist?(self.framework_path)
|
56
59
|
FileUtils.mv File.join(@path, "template-master"), self.framework_path
|
57
|
-
puts '=> Template uncompressed'.colorize(:green)
|
60
|
+
puts '=> Template uncompressed'.colorize(:green) if @verbose
|
58
61
|
end
|
59
62
|
|
60
63
|
def rename_files(path)
|
@@ -68,7 +71,7 @@ module Pandora
|
|
68
71
|
end
|
69
72
|
|
70
73
|
def rename_files_content
|
71
|
-
puts "=> Renaming files content".colorize(:green)
|
74
|
+
puts "=> Renaming files content".colorize(:green) if @verbose
|
72
75
|
Dir[File.join(self.framework_path, "**/*")]
|
73
76
|
.select { |fn| !File.directory?(fn) }
|
74
77
|
.each do |file_path|
|
@@ -77,7 +80,7 @@ module Pandora
|
|
77
80
|
new_contents = new_contents.gsub("YYYYY", @organization)
|
78
81
|
File.open(file_path, "w") {|file| file.puts new_contents }
|
79
82
|
end
|
80
|
-
puts "=> Contents renamed".colorize(:green)
|
83
|
+
puts "=> Contents renamed".colorize(:green) if @verbose
|
81
84
|
end
|
82
85
|
|
83
86
|
def project_path
|
data/lib/pandora/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pandora-frameworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Piñera Buendía
|
@@ -189,6 +189,7 @@ files:
|
|
189
189
|
- ".byebug_history"
|
190
190
|
- ".gitignore"
|
191
191
|
- ".travis.yml"
|
192
|
+
- AUTHORS
|
192
193
|
- CODE_OF_CONDUCT.md
|
193
194
|
- Gemfile
|
194
195
|
- LICENSE.txt
|