yanapiri 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: eeaeba7a366a0b292357f53c1927b922921d53ac
4
- data.tar.gz: 03161dbd5f7c27f1fda3cbbf9dbf69c9ad4723cd
2
+ SHA256:
3
+ metadata.gz: 8a50f96efb71cfbc154cac1b88548361523998c6ccd242567c789f184c6f613a
4
+ data.tar.gz: 11f009d684025a57cb9db8fbc80e9e01895072d7d6a8cdfc1bd58e9069aabf75
5
5
  SHA512:
6
- metadata.gz: 214237b162c0b874a90e0d3858d3639d10e0337c9a3d2e638941ec631e5ca794de437bf25bcdbb64200e041a6ebdf044636f1ea5a1bfc3516246fabffddfd8d5
7
- data.tar.gz: 25d1812c9576b1f5eff20ecb92ba5869e513390738006177864827773e13a7550450c94bbec4f178cf01546976cc118e9ec179afe88d010fa7559e0661791992
6
+ metadata.gz: 154dd40edaa2cfde3f5e3ac298e71bf466cda973442a0d6bc5ce419d4c3ebc8ebf40679a198b0a74942df59cbd11b6f8534f9f84b24ae1fdf7afa1af0ee5d129
7
+ data.tar.gz: 7e8221e46fd33abc09765a3b7060499ea458663297281470f838ca3cd76684cdf126cfa73b8a52ec16598defc9999d02a136462344e4602edb21bfb251b43787
data/.gitignore CHANGED
@@ -12,6 +12,7 @@
12
12
  /test/tmp/
13
13
  /test/version_tmp/
14
14
  /tmp/
15
+ Gemfile.lock
15
16
 
16
17
  ## Specific to RubyMotion:
17
18
  .dat*
@@ -38,4 +39,4 @@ build-iPhoneSimulator/
38
39
  .rspec_status
39
40
 
40
41
  #### jetbrains ####
41
- .idea
42
+ .idea
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.6.3
data/.travis.yml CHANGED
@@ -1,7 +1,14 @@
1
- ---
2
1
  sudo: false
3
2
  language: ruby
4
3
  cache: bundler
5
4
  rvm:
6
- - 2.3.1
5
+ - 2.6.3
7
6
  before_install: gem install bundler -v 2.0.1
7
+ deploy:
8
+ provider: rubygems
9
+ api_key:
10
+ secure: EeoAjhLUodzU6JQEjkwb5VrItqztFNe8UINerGX0+pw6sDo/BLKQyIn5qQauc+lsuu4vn1/AOlAV+zVRmsBfPGM7QB7FbVHiv+Ru21MZ189evc94T43cjnP4AQzza8Y/30Avqz/IM7PIXM24fMmMdYApyYtW/itHXJoZC6202sPO71yQ95X8YzKfGPAqCGiYpLQzZXHPk9gRVn2LC+DALz/ARMPTMd3gf7F5pPdpto4h0vMhAV52HJxXB3RShi9cbQ2unRmTKTWblQJ3N7BJqZspcl7OA8FdzT5v8bnJulRi4uXCm54Rh0VCZqBryhgdZFdrYFKPv162R4JwY/Q9ug0gGJ3ZvApYKZxubbYAYUBIc9JZza2FmPGrb1f4y21i2JGObpx9+BSOk7TbFIDn3dsQPRplGma+E6/DD5q51dYK56bCdI2FKLF3ImvqqkeFF3tP3L/i0rxj2IhETcuYF7Aoc2rInMKj+zdMAxTFnuO/y8K2kZSw7VPrN/fX1ZbV4pzjxRY+8jUYPCqXkVX3UD0IWtFbfaNKrpxDJNcGO/OZFx2TR/llz8v4H04TIREerKkcCv73QhpceXzB7VzF0e8ADsBDtO8WbsNO4/Qbyxi+S9r9c6ppS/TX3USGMXUVGn0t4cX24Wzvdkp8ntVM5LvkSQKu0BbIJ+MI3PbwoXg=
11
+ gem: yanapiri
12
+ on:
13
+ tags: true
14
+ repo: faloi/yanapiri
data/README.md CHANGED
@@ -1,5 +1,12 @@
1
+ [![Gem Version](https://badge.fury.io/rb/yanapiri.svg)](https://rubygems.org/gems/yanapiri)
2
+ [![Build Status](https://travis-ci.org/faloi/yanapiri.svg?branch=master)](https://travis-ci.org/faloi/yanapiri)
3
+
1
4
  # Yanapiri
2
5
 
6
+ Yanapiri es un vocablo aymara que significa "ayudante" o "el que ayuda".
7
+
8
+ A partir de este humilde aporte, es también una aplicación de línea de comandos (CLI) para asistir a docentes en ciertas tareas relacionadas al manejo de entregas a través de [GitHub Classroom](https://classroom.github.com/).
9
+
3
10
  ## Instalación
4
11
 
5
12
  Yanapiri funciona con Ruby, por lo cual es necesario instalarlo antes. Podés consultar cómo hacerlo en [la documentación oficial](https://www.ruby-lang.org/es/documentation/installation/).
data/lib/yanapiri/bot.rb CHANGED
@@ -21,7 +21,7 @@ class Bot
21
21
  def preparar_correccion!(entrega, commit_base)
22
22
  entrega.crear_branch! 'base', commit_base
23
23
  entrega.crear_branch! 'entrega', 'master'
24
- renombrar_proyecto_wollok! entrega
24
+ TransformacionWollok.transformar!(entrega, self) if TransformacionWollok.aplica?(entrega)
25
25
  publicar_cambios! entrega
26
26
  crear_pull_request! entrega
27
27
  end
@@ -48,6 +48,10 @@ class Bot
48
48
  @gh_client.user
49
49
  end
50
50
 
51
+ def commit!(repo, mensaje)
52
+ repo.commit_all mensaje, author: git_author
53
+ end
54
+
51
55
  private
52
56
 
53
57
  def aplanar_commits!(repo)
@@ -62,23 +66,10 @@ class Bot
62
66
  Git.clone "git@github.com:#{repo_slug}.git", repo_slug.split('/').last
63
67
  end
64
68
 
65
- def commit!(repo, mensaje)
66
- repo.commit_all mensaje, author: git_author
67
- end
68
-
69
69
  def crear_pull_request!(entrega)
70
70
  @gh_client.create_pull_request("#{@organization}/#{entrega.id}", "base", "entrega", "Corrección", entrega.mensaje_pull_request) rescue nil
71
71
  end
72
72
 
73
- def renombrar_proyecto_wollok!(entrega)
74
- entrega.repo.chdir do
75
- xml = File.read proyecto_wollok
76
- File.open(proyecto_wollok, "w") {|file| file.puts xml.sub(/<name>.*<\/name>/, "<name>#{entrega.id}</name>") }
77
- end
78
-
79
- commit! entrega.repo, 'Renombrado proyecto Wollok'
80
- end
81
-
82
73
  def publicar_repo!(nombre, repo)
83
74
  repo_nuevo = crear_repo!(nombre)
84
75
  repo.remote('origin').remove
@@ -93,8 +84,4 @@ class Bot
93
84
  def publicar_cambios!(entrega)
94
85
  entrega.repo.push 'origin', '--all'
95
86
  end
96
-
97
- def proyecto_wollok
98
- '.project'
99
- end
100
87
  end
@@ -43,6 +43,10 @@ class Entrega
43
43
  @repo.branch(nombre).checkout
44
44
  end
45
45
 
46
+ def contiene_archivo?(nombre)
47
+ @repo.chdir { File.exist? nombre }
48
+ end
49
+
46
50
  private
47
51
 
48
52
  def formato_humano(fecha)
@@ -0,0 +1,18 @@
1
+ module TransformacionWollok
2
+ def self.aplica?(entrega)
3
+ entrega.contiene_archivo? proyecto_wollok
4
+ end
5
+
6
+ def self.transformar!(entrega, bot)
7
+ entrega.repo.chdir do
8
+ xml = File.read proyecto_wollok
9
+ File.open(proyecto_wollok, "w") {|file| file.puts xml.sub(/<name>.*<\/name>/, "<name>#{entrega.id}</name>") }
10
+ end
11
+
12
+ bot.commit! entrega.repo, 'Renombrado proyecto Wollok'
13
+ end
14
+
15
+ def self.proyecto_wollok
16
+ '.project'
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Yanapiri
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/yanapiri.rb CHANGED
@@ -8,6 +8,7 @@ require 'active_support/all'
8
8
  require_relative './yanapiri/version'
9
9
  require_relative './yanapiri/entrega'
10
10
  require_relative './yanapiri/bot'
11
+ require_relative './yanapiri/transformacion_wollok'
11
12
 
12
13
  module Yanapiri
13
14
  class CLI < Thor
data/yanapiri.gemspec CHANGED
@@ -24,9 +24,11 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "thor", "~> 0.20"
25
25
  spec.add_dependency "octokit", "~> 4.0"
26
26
  spec.add_dependency "git", "~> 1.5"
27
- spec.add_dependency "activesupport", "~> 4.2"
27
+ spec.add_dependency "activesupport", "~> 5.2"
28
28
 
29
29
  spec.add_development_dependency "bundler", "~> 2.0"
30
30
  spec.add_development_dependency "rake", "~> 10.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
+ spec.add_development_dependency "guard", "~> 2.0"
33
+ spec.add_development_dependency "guard-rake", "~> 1.0"
32
34
  end
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.2.0
4
+ version: 0.2.2
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-02 00:00:00.000000000 Z
11
+ date: 2019-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '4.2'
61
+ version: '5.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '4.2'
68
+ version: '5.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,34 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '3.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: guard-rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.0'
111
139
  description:
112
140
  email:
113
141
  - federico.aloi@gmail.com
@@ -121,7 +149,6 @@ files:
121
149
  - ".ruby-version"
122
150
  - ".travis.yml"
123
151
  - Gemfile
124
- - Gemfile.lock
125
152
  - Guardfile
126
153
  - LICENSE
127
154
  - README.md
@@ -132,6 +159,7 @@ files:
132
159
  - lib/yanapiri.rb
133
160
  - lib/yanapiri/bot.rb
134
161
  - lib/yanapiri/entrega.rb
162
+ - lib/yanapiri/transformacion_wollok.rb
135
163
  - lib/yanapiri/version.rb
136
164
  - yanapiri.gemspec
137
165
  homepage: https://github.com/faloi/yanapiri
@@ -153,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
181
  - !ruby/object:Gem::Version
154
182
  version: '0'
155
183
  requirements: []
156
- rubyforge_project:
157
- rubygems_version: 2.5.1
184
+ rubygems_version: 3.0.3
158
185
  signing_key:
159
186
  specification_version: 4
160
187
  summary: Ayudante para administrar entregas via GitHub Classroom.
data/Gemfile.lock DELETED
@@ -1,64 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- yanapiri (0.2.0)
5
- activesupport (~> 4.2)
6
- git (~> 1.5)
7
- octokit (~> 4.0)
8
- thor (~> 0.20)
9
-
10
- GEM
11
- remote: https://rubygems.org/
12
- specs:
13
- activesupport (4.2.10)
14
- i18n (~> 0.7)
15
- minitest (~> 5.1)
16
- thread_safe (~> 0.3, >= 0.3.4)
17
- tzinfo (~> 1.1)
18
- addressable (2.5.2)
19
- public_suffix (>= 2.0.2, < 4.0)
20
- concurrent-ruby (1.1.5)
21
- diff-lcs (1.3)
22
- faraday (0.15.4)
23
- multipart-post (>= 1.2, < 3)
24
- git (1.5.0)
25
- i18n (0.9.5)
26
- concurrent-ruby (~> 1.0)
27
- minitest (5.11.3)
28
- multipart-post (2.0.0)
29
- octokit (4.14.0)
30
- sawyer (~> 0.8.0, >= 0.5.3)
31
- public_suffix (3.0.3)
32
- rake (10.5.0)
33
- rspec (3.8.0)
34
- rspec-core (~> 3.8.0)
35
- rspec-expectations (~> 3.8.0)
36
- rspec-mocks (~> 3.8.0)
37
- rspec-core (3.8.0)
38
- rspec-support (~> 3.8.0)
39
- rspec-expectations (3.8.3)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.8.0)
42
- rspec-mocks (3.8.0)
43
- diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.8.0)
45
- rspec-support (3.8.0)
46
- sawyer (0.8.1)
47
- addressable (>= 2.3.5, < 2.6)
48
- faraday (~> 0.8, < 1.0)
49
- thor (0.20.3)
50
- thread_safe (0.3.6)
51
- tzinfo (1.2.5)
52
- thread_safe (~> 0.1)
53
-
54
- PLATFORMS
55
- ruby
56
-
57
- DEPENDENCIES
58
- bundler (~> 2.0)
59
- rake (~> 10.0)
60
- rspec (~> 3.0)
61
- yanapiri!
62
-
63
- BUNDLED WITH
64
- 2.0.1