nabokov 0.1.0 → 0.1.1
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 +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +5 -0
- data/Dangerfile +23 -0
- data/Gemfile +5 -2
- data/README.md +2 -0
- data/lib/nabokov/core/nabokovfile.rb +15 -7
- data/lib/nabokov/helpers/informator.rb +26 -23
- data/lib/nabokov/version.rb +1 -1
- data/nabokov.gemspec +2 -0
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64c97c9afb33fc642ef2ee17acd52415a7bb2d50
|
4
|
+
data.tar.gz: 17f19f93ace02cbc86b4c67761dcbba400641a57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8ccd7f1de94148b73ae52b0973f5a1af9fcdf846996c059b01eea2472a564f7a01e34cec4e32bf5ae78cbfd7b06a3c9646653d0184b4dd36380424ba24e7467
|
7
|
+
data.tar.gz: f003bb0705b04cba895b986eeb5fce6f80313e581d12add784083bcede370cc980a672da62a38234f0604b7d18b0ba4bc8ac07f65ed159b8f698efea3ce07a66
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Dangerfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
has_app_changes = !git.modified_files.grep(/lib/).empty?
|
2
|
+
has_test_changes = !git.modified_files.grep(/spec/).empty?
|
3
|
+
|
4
|
+
if has_app_changes && !has_test_changes
|
5
|
+
warn("Tests were not updated")
|
6
|
+
end
|
7
|
+
|
8
|
+
if github.pr_title.length < 5
|
9
|
+
fail "Please provide a meaningful Pull Request title"
|
10
|
+
end
|
11
|
+
|
12
|
+
if github.pr_body.length < 5
|
13
|
+
fail "Please provide a summary in the Pull Request description"
|
14
|
+
end
|
15
|
+
|
16
|
+
declared_trivial = (github.pr_title + github.pr_body).include?("#trivial") || !has_app_changes
|
17
|
+
changelog.check unless declared_trivial
|
18
|
+
|
19
|
+
protected_files = ["nabokov.gemspec", "Dangerfile", "Gemfile", ".gitignore", ".travis.yml", ".rubocop.yml", "Rakefile"]
|
20
|
+
protected_files.each do |file|
|
21
|
+
next if git.modified_files.grep(/#{file}/).empty?
|
22
|
+
warn("#{file} has been modified")
|
23
|
+
end
|
data/Gemfile
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gem "rspec", "~> 3.4"
|
4
3
|
gem "claide", "~> 1.0"
|
5
4
|
gem "cork", "~> 0.1"
|
6
|
-
gem "rake", "~> 10.0"
|
7
5
|
gem "git", git: "https://github.com/Antondomashnev/ruby-git.git"
|
8
6
|
|
7
|
+
gem "rspec", "~> 3.4"
|
9
8
|
gem "rubocop", "~> 0.42"
|
9
|
+
gem "rake", "~> 10.0"
|
10
|
+
|
11
|
+
gem "danger", "~> 3.0"
|
12
|
+
gem "danger-changelog"
|
data/README.md
CHANGED
@@ -3,6 +3,8 @@ Move mobile localization process up to the next level 🚀
|
|
3
3
|
|
4
4
|
|
5
5
|
[](https://github.com/Antondomashnev/nabokov/blob/master/LICENSE)
|
6
|
+
[](https://codebeat.co/projects/github-com-antondomashnev-nabokov)
|
7
|
+

|
6
8
|
|
7
9
|
## Current status
|
8
10
|
This project is on the early development stage and is *not ready for production*. The `master` branch is empty and now the current status can be checked in `develop` branch. Also readme is not ready at all and we'll be updated as soon as the first functional becomes to the `master` branch.
|
@@ -45,13 +45,8 @@ module Nabokov
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def read_content(content_hash)
|
48
|
-
|
49
|
-
|
50
|
-
self.localizations_repo_master_branch = localizations_repo[NabokovfileKeyes.localizations_repo_master_branch].nil? ? "master" : localizations_repo[NabokovfileKeyes.localizations_repo_master_branch]
|
51
|
-
project_repo = content_hash[NabokovfileKeyes.project_repo]
|
52
|
-
self.project_localization_file_paths = project_repo[NabokovfileKeyes.project_localization_file_paths]
|
53
|
-
self.project_local_path = project_repo[NabokovfileKeyes.project_local_path]
|
54
|
-
self.localizations_repo_local_path = build_localization_local_path
|
48
|
+
read_localizations_repo_content(content_hash)
|
49
|
+
read_project_repo_content(content_hash)
|
55
50
|
end
|
56
51
|
|
57
52
|
def build_localization_local_path
|
@@ -62,5 +57,18 @@ module Nabokov
|
|
62
57
|
nabokov_dir_name = "/.nabokov"
|
63
58
|
home_dir + nabokov_dir_name + repo_url_organization + "/" + repo_url_name_without_extension
|
64
59
|
end
|
60
|
+
|
61
|
+
def read_localizations_repo_content(content_hash)
|
62
|
+
localizations_repo = content_hash[NabokovfileKeyes.localizations_repo]
|
63
|
+
self.localizations_repo_url = localizations_repo[NabokovfileKeyes.localizations_repo_url]
|
64
|
+
self.localizations_repo_master_branch = localizations_repo[NabokovfileKeyes.localizations_repo_master_branch].nil? ? "master" : localizations_repo[NabokovfileKeyes.localizations_repo_master_branch]
|
65
|
+
end
|
66
|
+
|
67
|
+
def read_project_repo_content(content_hash)
|
68
|
+
project_repo = content_hash[NabokovfileKeyes.project_repo]
|
69
|
+
self.project_localization_file_paths = project_repo[NabokovfileKeyes.project_localization_file_paths]
|
70
|
+
self.project_local_path = project_repo[NabokovfileKeyes.project_local_path]
|
71
|
+
self.localizations_repo_local_path = build_localization_local_path
|
72
|
+
end
|
65
73
|
end
|
66
74
|
end
|
@@ -45,39 +45,42 @@ module Nabokov
|
|
45
45
|
|
46
46
|
def ask_with_answers(question, possible_answers)
|
47
47
|
ui.print("\n#{question}? [")
|
48
|
-
|
49
|
-
print_info = proc do
|
50
|
-
possible_answers.each_with_index do |answer, i|
|
51
|
-
the_answer = i.zero? ? answer.underline : answer
|
52
|
-
ui.print " " + the_answer
|
53
|
-
ui.print(" /") if i != possible_answers.length - 1
|
54
|
-
end
|
55
|
-
ui.print " ]\n"
|
56
|
-
end
|
57
|
-
print_info.call
|
58
|
-
|
48
|
+
print_possible_answers(possible_answers)
|
59
49
|
answer = ""
|
60
|
-
|
61
50
|
loop do
|
62
51
|
show_prompt
|
63
|
-
answer =
|
64
|
-
|
65
|
-
answer = "yes" if answer == "y"
|
66
|
-
answer = "no" if answer == "n"
|
67
|
-
|
68
|
-
# default to first answer
|
69
|
-
if answer == ""
|
70
|
-
answer = possible_answers[0].downcase
|
71
|
-
ui.puts "Using: " + answer.yellow
|
72
|
-
end
|
52
|
+
answer = read_answer(possible_answers)
|
73
53
|
|
74
54
|
break if possible_answers.map(&:downcase).include? answer
|
75
55
|
|
76
56
|
ui.print "\nPossible answers are ["
|
77
|
-
|
57
|
+
print_possible_answers(possible_answers)
|
78
58
|
end
|
59
|
+
answer
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
79
63
|
|
64
|
+
def read_answer(possible_answers)
|
65
|
+
answer = @no_waiting ? possible_answers[0].downcase : STDIN.gets.downcase.chomp
|
66
|
+
answer = "yes" if answer == "y"
|
67
|
+
answer = "no" if answer == "n"
|
68
|
+
|
69
|
+
# default to first answer
|
70
|
+
if answer == ""
|
71
|
+
answer = possible_answers[0].downcase
|
72
|
+
ui.puts "Using: " + answer.yellow
|
73
|
+
end
|
80
74
|
answer
|
81
75
|
end
|
76
|
+
|
77
|
+
def print_possible_answers(possible_answers)
|
78
|
+
possible_answers.each_with_index do |answer, i|
|
79
|
+
the_answer = i.zero? ? answer.underline : answer
|
80
|
+
ui.print " " + the_answer
|
81
|
+
ui.print(" /") if i != possible_answers.length - 1
|
82
|
+
end
|
83
|
+
ui.print " ]\n"
|
84
|
+
end
|
82
85
|
end
|
83
86
|
end
|
data/lib/nabokov/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Nabokov
|
2
|
-
VERSION = "0.1.
|
2
|
+
VERSION = "0.1.1".freeze
|
3
3
|
DESCRIPTION = "One of the way to work on the localization - store it in the separate github repo
|
4
4
|
and asks localization team to update files in that repo.
|
5
5
|
This solution brings as well advantages but as well a disadvantages, to minimize the disadvantages
|
data/nabokov.gemspec
CHANGED
@@ -25,6 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_runtime_dependency "claide", "~> 1.0"
|
26
26
|
spec.add_runtime_dependency "cork", "~> 0.1"
|
27
27
|
|
28
|
+
spec.add_development_dependency "danger", "~> 3.0"
|
29
|
+
spec.add_development_dependency "danger-changelog"
|
28
30
|
spec.add_development_dependency "rubocop", "~> 0.42"
|
29
31
|
spec.add_development_dependency "bundler", "~> 1.3"
|
30
32
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nabokov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Domashnev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -66,6 +66,34 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: danger
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: danger-changelog
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rubocop
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,6 +155,7 @@ files:
|
|
127
155
|
- ".rubocop.yml"
|
128
156
|
- ".travis.yml"
|
129
157
|
- CHANGELOG.md
|
158
|
+
- Dangerfile
|
130
159
|
- Gemfile
|
131
160
|
- LICENSE
|
132
161
|
- README.md
|