zettacode 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af0e7668319646395caac31e03a7235bdfd8f4b669535c0107571f4dc5187c37
4
- data.tar.gz: a66c1da950d44ce6a9dc5bad43694d6da74751a4329c2fa8c9cb65a7698a7fd3
3
+ metadata.gz: f579bfba963a1101694ba42d392732b0367d61d32d0e7464c546dc544557668d
4
+ data.tar.gz: 6501f595e29aedf44aadd2cbfd6028e05bc674b23a6550d8d538cd4c800c5525
5
5
  SHA512:
6
- metadata.gz: db6b9bd56dd02747b5e57f90b4241f23f9af0721f5e0ea213ecf04fcc433e564ab6aa71cbb4643f25a66f4da620005e98b765e44ef1bfb6ed6762d7a18a4639e
7
- data.tar.gz: 19b1abbde65b1182ce70a3f68a0ed999f22c1d01570589169aa5a16d66ab08390fa1903e3ad8df7c9664131d0f686ee4c274c185f1079a726e2e0ee6e6f8cb83
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.files) usign `zettacode`. Every time, I will use `zettacode`, I will save results into `files.zettacode` folder.
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. Zettacode application
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,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "optparse"
3
- require_relative "../lib/zettacode"
3
+ require "zettacode"
4
4
 
5
5
  options = {}
6
6
  OptionParser.new do |opts|
@@ -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("files.zettacode", name)
33
+ folder = File.join(Zettacode::OUTPUT_FOLDER, name)
33
34
  FileUtils.mkdir(folder) unless Dir.exist? folder
34
35
  [content, folder]
35
36
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zettacode
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  OUTPUT_FOLDER = "files.zettacode"
6
6
  end
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}/bin/zettacode /usr/local/bin/zettacode")
6
+ system("sudo ln -s #{basedir}/zettacode /usr/local/bin/zettacode")
7
7
  end
8
8
  end
@@ -0,0 +1,4 @@
1
+ .vagrant
2
+ private*
3
+ *.log
4
+ *.box
@@ -0,0 +1 @@
1
+ system
@@ -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
@@ -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.2
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
- - zcode-scrap
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:
data/zcode-scrap DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative "../lib/zettacode/scrap/scrap"
4
-
5
- scrap = Zettacode::Scrap.new("config/scrap.yaml")
6
- scrap.load_settings
7
- scrap.find_langs