yanapiri 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -0
- data/lib/locales/es-AR.yml +1 -1
- data/lib/yanapiri.rb +4 -3
- data/lib/yanapiri/cli.rb +21 -5
- data/lib/yanapiri/entrega.rb +12 -7
- data/lib/yanapiri/multi_source_config.rb +7 -0
- data/lib/yanapiri/version.rb +1 -1
- data/yanapiri.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e288ec4bbb3f9a47c851c93e423ff4cb6ede778ec00bfe7fc60048c987c1ef5
|
4
|
+
data.tar.gz: 19039293ca505e26707b100516c1e44105e652a3c3a7212bae34281a92be91d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 830d0aa13bf24f870f6f4d271ca00edd719ff118ada4fbe2b21b0be20b425778d239f0a457f270ddacba1f423d64f461ab4c160a9ad2c186716f27d2789f0c9f
|
7
|
+
data.tar.gz: 375b90d3b5d5744ffe5f9a9de9fa613c894c25d8fb1dfa6e730687ea473ddf107ac70cf2b7d05c2a761ea5b5e37e8b14edc5d4085f3e5d09652c04abf5d90e30
|
data/Rakefile
CHANGED
data/lib/locales/es-AR.yml
CHANGED
data/lib/yanapiri.rb
CHANGED
@@ -7,11 +7,12 @@ require 'active_support/all'
|
|
7
7
|
require 'action_view'
|
8
8
|
require 'action_view/helpers'
|
9
9
|
|
10
|
-
require_relative './yanapiri/version'
|
11
|
-
require_relative './yanapiri/entrega'
|
12
10
|
require_relative './yanapiri/bot'
|
13
|
-
require_relative './yanapiri/transformacion_wollok'
|
14
11
|
require_relative './yanapiri/cli'
|
12
|
+
require_relative './yanapiri/entrega'
|
13
|
+
require_relative './yanapiri/multi_source_config'
|
14
|
+
require_relative './yanapiri/transformacion_wollok'
|
15
|
+
require_relative './yanapiri/version'
|
15
16
|
|
16
17
|
module Yanapiri
|
17
18
|
end
|
data/lib/yanapiri/cli.rb
CHANGED
@@ -44,7 +44,7 @@ module Yanapiri
|
|
44
44
|
config = OpenStruct.new
|
45
45
|
config.orga = ask 'Nombre de la organización:', default: File.basename(Dir.pwd)
|
46
46
|
leer_opciones_comunes! config
|
47
|
-
success "De ahora en más, trabajaré con la organización #{config.orga} siempre que estés dentro de esta carpeta.
|
47
|
+
success "De ahora en más, trabajaré con la organización #{config.orga} siempre que estés dentro de esta carpeta. #{opciones_correccion config}"
|
48
48
|
dump_local_config! config
|
49
49
|
end
|
50
50
|
|
@@ -83,9 +83,10 @@ module Yanapiri
|
|
83
83
|
desc 'corregir [ENTREGA]', 'Prepara la entrega para la corrección, creando los archivos y el pull request'
|
84
84
|
option :commit_base, {required: true, aliases: :b}
|
85
85
|
option :fecha_limite, {default: Time.now.to_s, aliases: :l}
|
86
|
-
option :renombrar_proyecto_wollok, {type: :boolean
|
87
|
-
option :modo_estricto, {type: :boolean
|
86
|
+
option :renombrar_proyecto_wollok, {type: :boolean}
|
87
|
+
option :modo_estricto, {type: :boolean}
|
88
88
|
def corregir(nombre)
|
89
|
+
info "Comenzando corrección de #{nombre}. #{opciones_correccion}"
|
89
90
|
foreach_entrega(nombre) do |entrega|
|
90
91
|
@bot.preparar_correccion! entrega, options.renombrar_proyecto_wollok ? [TransformacionWollok] : []
|
91
92
|
end
|
@@ -104,6 +105,10 @@ module Yanapiri
|
|
104
105
|
end
|
105
106
|
|
106
107
|
no_commands do
|
108
|
+
def opciones_correccion(config = options)
|
109
|
+
"Al corregir, utilizaré el modo #{config.modo_estricto ? 'estricto' : 'relajado'} y #{config.renombrar_proyecto_wollok ? '' : 'no '}renombraré los proyectos Wollok."
|
110
|
+
end
|
111
|
+
|
107
112
|
def crear_bot(config)
|
108
113
|
Bot.new config.orga, Octokit::Client.new(access_token: config.github_token)
|
109
114
|
end
|
@@ -135,7 +140,9 @@ module Yanapiri
|
|
135
140
|
|
136
141
|
def foreach_entrega(nombre)
|
137
142
|
foreach_repo(nombre) do |repo, base_path|
|
138
|
-
|
143
|
+
entrega = Entrega.new "#{base_path}/#{repo}", options.commit_base, Time.parse(options.fecha_limite), options.modo_estricto
|
144
|
+
debug "Trabajando con #{entrega}..."
|
145
|
+
yield entrega
|
139
146
|
end
|
140
147
|
end
|
141
148
|
|
@@ -182,7 +189,8 @@ module Yanapiri
|
|
182
189
|
original_options = super
|
183
190
|
defaults_global = load_config global_config_file
|
184
191
|
defaults_local = load_config local_config_file
|
185
|
-
|
192
|
+
|
193
|
+
MultiSourceConfig.new defaults_global, defaults_local, original_options
|
186
194
|
end
|
187
195
|
|
188
196
|
def raise(message)
|
@@ -192,6 +200,14 @@ module Yanapiri
|
|
192
200
|
def success(message)
|
193
201
|
say "Yuspagara. #{message}", :green
|
194
202
|
end
|
203
|
+
|
204
|
+
def info(message)
|
205
|
+
say message, :yellow
|
206
|
+
end
|
207
|
+
|
208
|
+
def debug(message)
|
209
|
+
say message, :clear
|
210
|
+
end
|
195
211
|
end
|
196
212
|
end
|
197
213
|
end
|
data/lib/yanapiri/entrega.rb
CHANGED
@@ -45,6 +45,17 @@ module Yanapiri
|
|
45
45
|
crear_branch! 'base', commit_base
|
46
46
|
end
|
47
47
|
|
48
|
+
def to_s
|
49
|
+
string = "entrega de @#{autor}, "
|
50
|
+
string << if hay_cambios? then "modificada por última vez #{formato_humano fecha}" else "sin cambios" end
|
51
|
+
string << ' (fuera de término)' if fuera_de_termino?
|
52
|
+
string
|
53
|
+
end
|
54
|
+
|
55
|
+
def formato_humano(fecha)
|
56
|
+
I18n.l(fecha, format: :human)
|
57
|
+
end
|
58
|
+
|
48
59
|
private
|
49
60
|
|
50
61
|
def crear_branch!(nombre, head)
|
@@ -64,13 +75,7 @@ module Yanapiri
|
|
64
75
|
end
|
65
76
|
|
66
77
|
def mensaje_fuera_de_termino
|
67
|
-
"**Ojo:** tu último commit fue
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
def formato_humano(fecha)
|
73
|
-
I18n.l(fecha, format: :human)
|
78
|
+
"**Ojo:** tu último commit fue #{formato_humano fecha}, pero la fecha límite era #{formato_humano fecha_limite}.\n\n¡Tenés que respetar la fecha de entrega establecida! :point_up:"
|
74
79
|
end
|
75
80
|
end
|
76
81
|
|
data/lib/yanapiri/version.rb
CHANGED
data/yanapiri.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "actionview", '~> 5.2'
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 2.0"
|
31
|
+
spec.add_development_dependency "bump", "~> 0.8"
|
31
32
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
33
34
|
spec.add_development_dependency "guard", "~> 2.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yanapiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Aloi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bump
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.8'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.8'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,6 +190,7 @@ files:
|
|
176
190
|
- lib/yanapiri/bot.rb
|
177
191
|
- lib/yanapiri/cli.rb
|
178
192
|
- lib/yanapiri/entrega.rb
|
193
|
+
- lib/yanapiri/multi_source_config.rb
|
179
194
|
- lib/yanapiri/transformacion_wollok.rb
|
180
195
|
- lib/yanapiri/version.rb
|
181
196
|
- yanapiri.gemspec
|