waoc 1.0.0

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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/waoc +36 -0
  3. data/lib/waoc.rb +58 -0
  4. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ad5c6ee11a8cd0dc13b0f1abcad49e4eade61dec
4
+ data.tar.gz: 11283ba88bfa0f89c0cb6c3d618b86807cd693d9
5
+ SHA512:
6
+ metadata.gz: 28aa3613a155a28a43df3e73a026b8c094a75fe2b611a7c7244e6877f8b03f3194407a63ab0683ba14d57ce5f0a9c0ac4f3d2e62eed77f53140d6604d02bab63
7
+ data.tar.gz: 59c17274d0049b4a9a39c4ab06a088ce1c046aca74a74a8cd278b78f4b58b207ab048079b81e87aa17fc9708702d11d219c755443209d3386c6a02a84ec7d970
data/bin/waoc ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'waoc'
4
+
5
+ opt1 = ARGV[0] #comando
6
+
7
+ case opt1
8
+ when "install"
9
+ WaOC.install
10
+
11
+ when "edit"
12
+ opt2 = ARGV[1] #{{store_id}}
13
+ opt3 = ARGV[2] #{{dev_key}}
14
+ opt4 = ARGV[3] #{{pass_key}}
15
+ opt5 = ARGV[4] #{{theme_id}}
16
+ WaOC.edit opt2, opt3, opt4, opt5
17
+
18
+ when "work"
19
+ opt2 = ARGV[1] #{{store_id}}
20
+ WaOC.work opt2
21
+
22
+ when "stop"
23
+ puts "✔ Todos os processos foram parados"
24
+ WaOC.stop
25
+ WaOC.stop
26
+ puts "✔ Todos os processos foram parados"
27
+
28
+ when "version"
29
+ WaOC.version
30
+
31
+ when nil
32
+ puts "Sem argumentos"
33
+
34
+ else
35
+ puts "Comando nao encontrado"
36
+ end
data/lib/waoc.rb ADDED
@@ -0,0 +1,58 @@
1
+ class WaOC
2
+
3
+ def self.install
4
+ puts "Instalando OpenCode"
5
+ sleep 1
6
+
7
+ puts "Baixando os arquivos"
8
+ system "wget https://github.com/Tray-FrontEnd/WaOC/raw/master/files/opencode_theme-0.0.2.gem"
9
+ system "wget https://raw.githubusercontent.com/Tray-FrontEnd/WaOC/master/files/gulpfile.js"
10
+ system "wget https://raw.githubusercontent.com/Tray-FrontEnd/WaOC/master/files/package.json"
11
+
12
+ puts "Instalando OpenCode"
13
+ sleep 1
14
+ system "gem install opencode_theme-0.0.2.gem"
15
+
16
+ puts "Instalando as dependências com NPM"
17
+ system "npm install"
18
+
19
+ puts "✔ Opencode instalado com sucesso"
20
+ end
21
+
22
+ def self.edit(storeId, devKey, passKey, themeId)
23
+ if storeId == "" && devKey == "" && passKey == "" && themeId == ""
24
+ puts "✘ Esta faltando alguns parametros, por favor, leia a documentacao"
25
+ else
26
+ FileUtils.mkdir(storeId.to_s)
27
+ Dir.chdir(storeId.to_s)
28
+ system "opencode configure " + devKey.to_s + " " + passKey.to_s + " " + themeId.to_s
29
+
30
+ sleep 3
31
+ exec "opencode download"
32
+ puts "✔ Loja pronta para ser editada"
33
+ end
34
+ end
35
+
36
+ def self.work(storeId)
37
+ if(storeId == "")
38
+ puts "✘ Está faltando o ID da loja"
39
+ else
40
+ puts "Iniciando Work..."
41
+ Dir.chdir(storeId)
42
+ system "opencode watch &"
43
+ Dir.chdir("../")
44
+ system "gulp &"
45
+ puts "✔ Modo Work ON"
46
+ end
47
+ end
48
+
49
+ def self.stop
50
+ system "pkill ruby"
51
+ system "pkill opencode"
52
+ system "pkill gulp"
53
+ end
54
+
55
+ def self.version
56
+ puts "WaOC Alpha v1"
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: waoc
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Evandro Zanatta
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Waoc for OpenCode
14
+ email: ezanatta@tray.net.br
15
+ executables:
16
+ - waoc
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/waoc
21
+ - lib/waoc.rb
22
+ homepage:
23
+ licenses: []
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.4.6
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Waoc
45
+ test_files: []