besturder 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/besturder +5 -0
- data/lib/besturder.rb +58 -0
- data/lib/packs.json +26 -0
- metadata +47 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 75e7c239ec84e98d0145c2ef62ee2a9415859654
|
4
|
+
data.tar.gz: e7c442feffaa4de3f4070c12d5f4f95bb07d3a64
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f330ae9bea261e9fb18742e8927aa2a9d7b62206b98eeca0209113f2a024f98d66fb27ca192bbd80350506e92b54d01a6b0d9fb18f0e8e39a01b3b445f3d8997
|
7
|
+
data.tar.gz: d164d7f723b16ec32f239d094af9695a17984ec54ecf972074a9339a5211a0a906fe0f3a9f6e25a2be30f2d1f0df643f2cb882536ea7c8980000386807f2de59
|
data/bin/besturder
ADDED
data/lib/besturder.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require "open-uri"
|
2
|
+
require "json"
|
3
|
+
$jsonfile = "package.json"
|
4
|
+
$packs = JSON.parse(File.read("#{File.expand_path(File.dirname(__FILE__))}/packs.json"))
|
5
|
+
def download(key)
|
6
|
+
unless File.exists? $packs[key]["dir"]
|
7
|
+
puts "Instalando la dependencia #{key}..."
|
8
|
+
File.open($packs[key]["dir"], "w") do |file|
|
9
|
+
opena = open($packs[key]['url']).read
|
10
|
+
opena.lines.each do |line|
|
11
|
+
file << line
|
12
|
+
end
|
13
|
+
end
|
14
|
+
puts "Se ha instalado la dependencia #{key}!"
|
15
|
+
else
|
16
|
+
puts "Ya tienes instalada la dependencia #{key}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
class Besturder
|
20
|
+
def initialize
|
21
|
+
if File.exist? $jsonfile then
|
22
|
+
json = JSON.parse File.read $jsonfile
|
23
|
+
dependencies = json["dependencies"]
|
24
|
+
if dependencies.size != 0 then
|
25
|
+
Dir.mkdir "js" unless Dir.exist? "js"
|
26
|
+
Dir.mkdir "css" unless Dir.exist? "css"
|
27
|
+
dependencies.each do |value|
|
28
|
+
download(value) if $packs.keys.include? value
|
29
|
+
puts "No existe la dependencia #{value}" unless $packs.keys.include? value
|
30
|
+
end
|
31
|
+
else
|
32
|
+
puts "No tienes dependencias en tu #{$jsonfile}"
|
33
|
+
end
|
34
|
+
else
|
35
|
+
print "El fichero #{$jsonfile} no existe, desea crearlo?[Y/N]"
|
36
|
+
s_n = gets.chomp
|
37
|
+
if s_n.upcase == "Y" then
|
38
|
+
print "\tNombre de la aplicación: "
|
39
|
+
name = gets.chomp
|
40
|
+
print "\tVersion de la aplicación: "
|
41
|
+
version = gets.chomp
|
42
|
+
print "\tAhora escriba las dependencias (separadas por comas y sin espacios): "
|
43
|
+
dependencia = gets.chomp
|
44
|
+
dependencia = dependencia.split(",")
|
45
|
+
dependencia.each { |a| a.downcase! }
|
46
|
+
json = {name:name,version:version,dependencies:dependencia}
|
47
|
+
json = JSON.pretty_generate json
|
48
|
+
file = File.open("#{$jsonfile}", "w") do |b|
|
49
|
+
b << json
|
50
|
+
end
|
51
|
+
puts "Archivo creado sin errores!"
|
52
|
+
puts "Vuelva a ejecutar el código"
|
53
|
+
else
|
54
|
+
exit
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/packs.json
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"jquery": {
|
3
|
+
"url":"http://code.jquery.com/jquery-latest.min.js",
|
4
|
+
"dir":"js/jquery.min.js"
|
5
|
+
},
|
6
|
+
"normalize": {
|
7
|
+
"url":"https://necolas.github.io/normalize.css/latest/normalize.css",
|
8
|
+
"dir":"css/normalize.css"
|
9
|
+
},
|
10
|
+
"dojotk": {
|
11
|
+
"url":"http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js",
|
12
|
+
"dir":"js/dojo.js"
|
13
|
+
},
|
14
|
+
"mootools_core": {
|
15
|
+
"url":"https://ajax.googleapis.com/ajax/libs/mootools/1.5.2/mootools.min.js",
|
16
|
+
"dir":"js/mootools.min.js"
|
17
|
+
},
|
18
|
+
"bootstrap": {
|
19
|
+
"url":"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css",
|
20
|
+
"dir":"css/bootstrap.min.css"
|
21
|
+
},
|
22
|
+
"bootstrapjs": {
|
23
|
+
"url":"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js",
|
24
|
+
"dir":"js/bootstrap.min.js"
|
25
|
+
}
|
26
|
+
}
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: besturder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.7
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daviz
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Besturder is a simple package manager for HTML5
|
14
|
+
email: roman.daco.st@gmail.com
|
15
|
+
executables:
|
16
|
+
- besturder
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- bin/besturder
|
21
|
+
- lib/besturder.rb
|
22
|
+
- lib/packs.json
|
23
|
+
homepage: https://github.com/DavizCO/Besturder
|
24
|
+
licenses:
|
25
|
+
- MIT
|
26
|
+
metadata: {}
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 2.4.8
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: This is a little package manager for HTML5
|
47
|
+
test_files: []
|