zettacode 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/bin/zettacode +1 -1
- data/lib/zettacode/parse/parse.rb +2 -1
- data/lib/zettacode/version.rb +1 -1
- data/tasks/devel.rb +1 -1
- data/vagrant/.gitignore +4 -0
- data/vagrant/.ruby-version +1 -0
- data/vagrant/Vagrantfile +19 -0
- data/vagrant/install.sh +29 -0
- data/zettacode +28 -0
- metadata +6 -2
- data/zcode-scrap +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f579bfba963a1101694ba42d392732b0367d61d32d0e7464c546dc544557668d
|
4
|
+
data.tar.gz: 6501f595e29aedf44aadd2cbfd6028e05bc674b23a6550d8d538cd4c800c5525
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2160249bac68d769b0a42adc3ea2d5bc858244e030049ddf8491492c134cc8c5ca5388435f104d1ae8935ee08d239217cf4e0cfbad20e689f7d8ff275b687ce8
|
7
|
+
data.tar.gz: aa85239d535347aa2ee08352e89387bbb01d297c0dea2f3783fe9a23757e13213ccfc64ae779567892c841365d6b6a346cea818331944eb67bd99cbb82994049
|
data/README.md
CHANGED
@@ -11,9 +11,9 @@
|
|
11
11
|
|
12
12
|
This repository has two sections:
|
13
13
|
1. `zettacode` app source code
|
14
|
-
2. [Repository of processed files](zettacode
|
14
|
+
2. [Repository of processed files](files.zettacode) usign `zettacode`. Every time, I use it, I will save outputs into `files.zettacode` folder.
|
15
15
|
|
16
|
-
# 1.
|
16
|
+
# 1. Application
|
17
17
|
|
18
18
|
`zettacode` is an application that helps us perform various tasks with files from the [rosettacode.org](https://rosettacode.org/wiki/Rosetta_Code) website.
|
19
19
|
|
data/bin/zettacode
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "colorize"
|
2
2
|
require "fileutils"
|
3
3
|
require "debug"
|
4
|
+
require_relative "../version"
|
4
5
|
|
5
6
|
module Zettacode
|
6
7
|
module Parse
|
@@ -29,7 +30,7 @@ module Zettacode
|
|
29
30
|
name.tr!("/", ".")
|
30
31
|
name.tr!(" ", "_")
|
31
32
|
name.downcase!
|
32
|
-
folder = File.join(
|
33
|
+
folder = File.join(Zettacode::OUTPUT_FOLDER, name)
|
33
34
|
FileUtils.mkdir(folder) unless Dir.exist? folder
|
34
35
|
[content, folder]
|
35
36
|
end
|
data/lib/zettacode/version.rb
CHANGED
data/tasks/devel.rb
CHANGED
@@ -3,6 +3,6 @@ namespace :devel do
|
|
3
3
|
task :launcher do
|
4
4
|
puts "[INFO] Creating symbolic link into /usr/local/bin"
|
5
5
|
basedir = File.join(File.dirname(__FILE__), "..")
|
6
|
-
system("sudo ln -s #{basedir}/
|
6
|
+
system("sudo ln -s #{basedir}/zettacode /usr/local/bin/zettacode")
|
7
7
|
end
|
8
8
|
end
|
data/vagrant/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
system
|
data/vagrant/Vagrantfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
NAME = "zettacode"
|
5
|
+
Vagrant.configure("2") do |config|
|
6
|
+
config.vm.define NAME do |i|
|
7
|
+
i.vm.box = "generic/debian11"
|
8
|
+
i.vm.hostname = NAME
|
9
|
+
# i.vm.network "public_network", bridge: [ "eth0" ]
|
10
|
+
# i.vm.network "public_network", bridge: [ "wlan0" ]
|
11
|
+
i.vm.network :forwarded_port, guest: 22, host: 2241
|
12
|
+
i.vm.synced_folder "./", "/vagrant"
|
13
|
+
i.vm.provision "shell", path: "install.sh"
|
14
|
+
i.vm.provider "virtualbox" do |v|
|
15
|
+
v.name = NAME
|
16
|
+
v.memory = 2048
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/vagrant/install.sh
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
APPNAME=zettacode
|
4
|
+
REPOURL=https://github.com/dvarrui/$APPNAME
|
5
|
+
|
6
|
+
apt update
|
7
|
+
apt install -y vim tree nmap
|
8
|
+
apt install -y neofetch
|
9
|
+
|
10
|
+
echo "[INFO] Install ruby and $APPNAME gem"
|
11
|
+
apt install -y ruby irb
|
12
|
+
gem install $APPNAME
|
13
|
+
|
14
|
+
echo "[INFO] Download repo"
|
15
|
+
apt install -y git
|
16
|
+
git clone $REPOURL
|
17
|
+
chown -R vagrant:vagrant $APPNAME
|
18
|
+
|
19
|
+
echo "[INFO] Configure motd"
|
20
|
+
apt install -y figlet
|
21
|
+
figlet $APPNAME > /etc/motd
|
22
|
+
echo "" >> /etc/motd
|
23
|
+
|
24
|
+
echo "[INFO] Configure aliases"
|
25
|
+
echo "# Adding more alias" >> /home/vagrant/.bashrc
|
26
|
+
echo "alias c='clear'" >> /home/vagrant/.bashrc
|
27
|
+
echo "alias v='vdir'" >> /home/vagrant/.bashrc
|
28
|
+
|
29
|
+
lsb_release -d
|
data/zettacode
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "optparse"
|
3
|
+
require_relative "lib/zettacode"
|
4
|
+
|
5
|
+
options = {}
|
6
|
+
OptionParser.new do |opts|
|
7
|
+
opts.banner = "Usage: zettacode [--parse FILENAME]"
|
8
|
+
|
9
|
+
opts.on("-p", "--parse", "Parse FILENAME") do |p|
|
10
|
+
options[:parse] = p
|
11
|
+
end
|
12
|
+
opts.on("-s", "--scrap", "Scrap RosettaCode URLs") do |s|
|
13
|
+
options[:scrap] = s
|
14
|
+
end
|
15
|
+
opts.on("-v", "--version", "Show version") do |v|
|
16
|
+
options[:version] = v
|
17
|
+
end
|
18
|
+
end.parse!
|
19
|
+
|
20
|
+
if options[:parse]
|
21
|
+
Zettacode::Parse.call(ARGV.first || "NODATA")
|
22
|
+
elsif options[:scrap]
|
23
|
+
scrap = Zettacode::Scrap.new("config/scrap.yaml")
|
24
|
+
scrap.load_settings
|
25
|
+
scrap.find_langs
|
26
|
+
elsif options[:version]
|
27
|
+
puts "zettacode #{Zettacode::VERSION}"
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zettacode
|
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
|
- David Vargas Ruiz
|
@@ -861,7 +861,11 @@ files:
|
|
861
861
|
- lib/zettacode/version.rb
|
862
862
|
- sig/zettacode.rbs
|
863
863
|
- tasks/devel.rb
|
864
|
-
-
|
864
|
+
- vagrant/.gitignore
|
865
|
+
- vagrant/.ruby-version
|
866
|
+
- vagrant/Vagrantfile
|
867
|
+
- vagrant/install.sh
|
868
|
+
- zettacode
|
865
869
|
- zettacode.gemspec
|
866
870
|
homepage: https://github.com/dvarrui/zettacode
|
867
871
|
licenses:
|