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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd71abc02d1c0469d5514b59900199790b2e9b8b
4
- data.tar.gz: 355a0707bbe1ea7196595098da5450a948868be1
3
+ metadata.gz: 64c97c9afb33fc642ef2ee17acd52415a7bb2d50
4
+ data.tar.gz: 17f19f93ace02cbc86b4c67761dcbba400641a57
5
5
  SHA512:
6
- metadata.gz: dc9ce5a4b6104c0b69074553d3a72ef7f49ae69ab83dd00a7051d44cd54ef69c0642abe87d5ad9d3e4c987fb1541be7a1cb181b1ad7712313ef411d2d7fbdd1e
7
- data.tar.gz: 828af0acfaa649d4713954b55d711a3c4a7fc32553ed47e79b87f5249a0b1e8ed1ee0b901243631db111d4d1b0c8851d039c83aaef7fa2a86c00ea2d7f4fec89
6
+ metadata.gz: f8ccd7f1de94148b73ae52b0973f5a1af9fcdf846996c059b01eea2472a564f7a01e34cec4e32bf5ae78cbfd7b06a3c9646653d0184b4dd36380424ba24e7467
7
+ data.tar.gz: f003bb0705b04cba895b986eeb5fce6f80313e581d12add784083bcede370cc980a672da62a38234f0604b7d18b0ba4bc8ac07f65ed159b8f698efea3ce07a66
@@ -12,3 +12,9 @@ bundler_args: "--without documentation --path bundle"
12
12
 
13
13
  before_install:
14
14
  - gem install bundler
15
+ - bundle install
16
+
17
+ script:
18
+ - bundle install
19
+ - bundle exec rake spec
20
+ - bundle exec danger --verbose
@@ -1,5 +1,10 @@
1
1
  ## master
2
2
 
3
+ ## 0.1.1
4
+
5
+ * Add Dangerfile
6
+ * Fix quickwins from the codebeat report [antondomashnev]
7
+
3
8
  ## 0.1
4
9
 
5
10
  * The very beginning of the nabokov
@@ -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
  [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/Antondomashnev/nabokov/blob/master/LICENSE)
6
+ [![codebeat badge](https://codebeat.co/badges/cd388b60-f4e0-4b2d-8278-a7d2764d642d)](https://codebeat.co/projects/github-com-antondomashnev-nabokov)
7
+ ![travis badge](https://travis-ci.org/Antondomashnev/nabokov.svg?branch=master)
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
- localizations_repo = content_hash[NabokovfileKeyes.localizations_repo]
49
- self.localizations_repo_url = localizations_repo[NabokovfileKeyes.localizations_repo_url]
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 = @no_waiting ? possible_answers[0].downcase : STDIN.gets.downcase.chomp
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
- print_info.call
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
@@ -1,5 +1,5 @@
1
1
  module Nabokov
2
- VERSION = "0.1.0".freeze
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
@@ -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.0
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-08 00:00:00.000000000 Z
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