big_keeper 0.5.0 → 0.6.0

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
2
  SHA1:
3
- metadata.gz: 4a3c399d6961d86ef419b46541eed58b809c484d
4
- data.tar.gz: 699643b23a3b95ef5d843918d0c4f1f8999be335
3
+ metadata.gz: f5d867efbd9a7de9b08c51986d5ca038d4f06eb4
4
+ data.tar.gz: 4819f7ac162d5ac8113daf85408c070569cc2a46
5
5
  SHA512:
6
- metadata.gz: 878010d015f1fab7c07d1392152badae3ef259e5c63b0b916ba0169be9fc616e25a7a6d59f2d35d76619a4567b06a20297e298b091bb599824ce39ce1c41d2fc
7
- data.tar.gz: 0b5cbce481f7330aaef652251c01e3ceab73b93bb4f6261ff414426cdce77bed903213e51d69e75e09606b2d023756efb84ad35e34ecf4ec0f4fcc3422cd2e1f
6
+ metadata.gz: a146247543a84a9f8fcd77b2af6ce402499d8c4db96e091e8ddade6cb940ce244e84548528fb9c8a87c7142570ff7a04199d5e3dd3c6775ed9359caca9303b42
7
+ data.tar.gz: 2a30911fb546424945102ac1969ded37385d456d5434843de2177d3663b837bd05b18cd7f90f4e5608b9891915d271e351f796e2728aca5707b1045ad687f3e9
@@ -0,0 +1,20 @@
1
+ ### Check List
2
+
3
+ Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.
4
+
5
+ - [ ] I have read the [README.md](https://github.com/BigKeeper/big-keeper/blob/master/README.md), but there is no information I need.
6
+ - [ ] I have searched in [existing issues](https://github.com/BigKeeper/big-keeper/issues?utf8=%E2%9C%93&q=is%3Aissue), but did find a same one.
7
+
8
+ ### Issue Description
9
+
10
+ #### Description
11
+
12
+ [Tell us about the issue]
13
+
14
+ #### Reproduce
15
+
16
+ [The steps to reproduce this issue. What are the parameters, where did you put your code, etc.]
17
+
18
+ #### Other Comment
19
+
20
+ [Add anything else here]
data/.travis.yml ADDED
@@ -0,0 +1,17 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.3.4
5
+ - 2.2.7
6
+ - 2.1.10
7
+
8
+ before_install:
9
+ - gem update --remote bundler
10
+ - gem update --system
11
+
12
+ sudo: false
13
+
14
+ bundler_args: --without=guard
15
+
16
+ notifications:
17
+ disabled: true
@@ -0,0 +1,46 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mmoaay@sina.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: http://contributor-covenant.org
46
+ [version]: http://contributor-covenant.org/version/1/4/
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,70 @@
1
+ # Contributing Guidelines
2
+
3
+ This document contains information and guidelines about contributing to this project.
4
+ Please read it before you start participating.
5
+
6
+ **Topics**
7
+
8
+ * [Asking Questions](#asking-questions)
9
+ * [Reporting Issues](#reporting-issues)
10
+ * [Developers Certificate of Origin](#developers-certificate-of-origin)
11
+
12
+ ## Asking Questions
13
+
14
+ We don't use GitHub as a support forum.
15
+ For any usage questions that are not specific to the project itself,
16
+ please ask on [Stack Overflow](https://stackoverflow.com) instead.
17
+ By doing so, you'll be more likely to quickly solve your problem,
18
+ and you'll allow anyone else with the same question to find the answer.
19
+ This also allows maintainers to focus on improving the project for others.
20
+
21
+ ## Reporting Issues
22
+
23
+ A great way to contribute to the project
24
+ is to send a detailed issue when you encounter an problem.
25
+ We always appreciate a well-written, thorough bug report.
26
+
27
+ Check that the project issues database
28
+ doesn't already include that problem or suggestion before submitting an issue.
29
+ If you find a match, add a quick "+1" or "I have this problem too."
30
+ Doing this helps prioritize the most common problems and requests.
31
+
32
+ When reporting issues, please include the following:
33
+
34
+ * The version of Xcode you're using
35
+ * The version of iOS or macOS you're targeting
36
+ * The full output of any stack trace or compiler error
37
+ * A code snippet that reproduces the described behavior, if applicable
38
+ * Any other details that would be useful in understanding the problem
39
+
40
+ This information will help us review and fix your issue faster.
41
+
42
+ ## Developer's Certificate of Origin
43
+
44
+ By making a contribution to this project, I certify that:
45
+
46
+ - (a) The contribution was created in whole or in part by me and I
47
+ have the right to submit it under the open source license
48
+ indicated in the file; or
49
+
50
+ - (b) The contribution is based upon previous work that, to the best
51
+ of my knowledge, is covered under an appropriate open source
52
+ license and I have the right under that license to submit that
53
+ work with modifications, whether created in whole or in part
54
+ by me, under the same open source license (unless I am
55
+ permitted to submit under a different license), as indicated
56
+ in the file; or
57
+
58
+ - (c) The contribution was provided directly to me by some other
59
+ person who certified (a), (b) or (c) and I have not modified
60
+ it.
61
+
62
+ - (d) I understand and agree that this project and the contribution
63
+ are public and that a record of the contribution (including all
64
+ personal information I submit with it, including my sign-off) is
65
+ maintained indefinitely and may be redistributed consistent with
66
+ this project or the open source license(s) involved.
67
+
68
+ ---
69
+
70
+ *Some of the ideas and wording for the statements above were based on work by the [Alamofire](https://github.com/Alamofire/Alamofire/blob/master/CONTRIBUTING.md) communities. We commend them for their efforts to facilitate collaboration in their projects.*
data/Gemfile CHANGED
@@ -1,6 +1,10 @@
1
- source "https://ruby.taobao.org"
1
+ source "https://gems.ruby-china.org/"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in big_keeper.gemspec
6
6
  gemspec
7
+
8
+ group :test do
9
+ gem 'rake'
10
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- big_keeper (0.4.0)
4
+ big_keeper (0.5.0)
5
5
  big_stash (~> 0.1)
6
6
  cocoapods
7
7
  colorize
@@ -9,7 +9,7 @@ PATH
9
9
  plist
10
10
 
11
11
  GEM
12
- remote: https://ruby.taobao.org/
12
+ remote: https://gems.ruby-china.org/
13
13
  specs:
14
14
  CFPropertyList (2.3.3)
15
15
  activesupport (4.2.7.1)
@@ -19,7 +19,8 @@ GEM
19
19
  thread_safe (~> 0.3, >= 0.3.4)
20
20
  tzinfo (~> 1.1)
21
21
  ast (2.3.0)
22
- big_stash (0.2.0)
22
+ big_stash (0.5.0)
23
+ gli (~> 2.16)
23
24
  claide (1.0.1)
24
25
  cocoapods (1.2.1)
25
26
  activesupport (>= 4.0.2, < 5)
@@ -60,7 +61,7 @@ GEM
60
61
  fourflusher (2.0.1)
61
62
  fuzzy_match (2.0.4)
62
63
  gh_inspector (1.0.2)
63
- gli (2.16.1)
64
+ gli (2.17.1)
64
65
  i18n (0.7.0)
65
66
  json (1.8.3)
66
67
  minitest (5.8.3)
@@ -106,7 +107,7 @@ DEPENDENCIES
106
107
  colorize
107
108
  gli (~> 2.16)
108
109
  plist
109
- rake (~> 10.0)
110
+ rake
110
111
  rubocop (~> 0.50.0)
111
112
 
112
113
  BUNDLED WITH
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 mmoaay
3
+ Copyright (c) 2017 BigKeeper.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  # big-keeper - All in home project
6
6
 
7
+ [![Build Status](https://travis-ci.org/BigKeeper/big-keeper.svg?branch=master)](https://travis-ci.org/BigKeeper/big-keeper)
8
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c6dc4161e84fcec9a890/maintainability)](https://codeclimate.com/github/BigKeeper/big-keeper/maintainability)
9
+ [![Gem Version](https://badge.fury.io/rb/big_keeper.svg)](https://rubygems.org/gems/big_keeper)
10
+ [![Language: Ruby](https://img.shields.io/badge/language-Ruby-da212f.svg)](https://www.ruby-lang.org/)
11
+ [![License](https://img.shields.io/badge/license-MIT-000000.svg)](https://github.com/BigKeeper/big-keeper/blob/master/LICENSE)
12
+ [![Gitter](https://img.shields.io/gitter/room/BigKeeper/BigKeeper.svg)](https://gitter.im/Big-Keeper/Lobby)
13
+
7
14
  big-keeper is an efficiency improvement for iOS modular development, iOSer using this tool can make modular development easier.
8
15
 
9
16
  ## Installation
@@ -38,4 +45,6 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/BigKee
38
45
 
39
46
  ## License
40
47
 
48
+ ![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png)
49
+
41
50
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/docs/zh-CN/README.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  # big-keeper - 我好像做了一个假的模块化项目
6
6
 
7
+ [![Build Status](https://travis-ci.org/BigKeeper/big-keeper.svg?branch=master)](https://travis-ci.org/BigKeeper/big-keeper)
8
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c6dc4161e84fcec9a890/maintainability)](https://codeclimate.com/github/BigKeeper/big-keeper/maintainability)
9
+ [![Gem Version](https://badge.fury.io/rb/big_keeper.svg)](https://rubygems.org/gems/big_keeper)
10
+ [![Language: Ruby](https://img.shields.io/badge/language-Ruby-da212f.svg)](https://www.ruby-lang.org/)
11
+ [![License](https://img.shields.io/badge/license-MIT-000000.svg)](https://github.com/BigKeeper/big-keeper/blob/master/LICENSE)
12
+ [![Gitter](https://img.shields.io/gitter/room/BigKeeper/BigKeeper.svg)](https://gitter.im/Big-Keeper/Lobby)
13
+
7
14
  big-keeper 是一个**iOS模块化项目过渡阶段**的效率提升工具,使用这个工具后,开发者**在主项目内**就可以完成**包括其他业务模块在内**所有代码的编写和管理。
8
15
 
9
16
  > 注:目前只支持依赖 CocoaPods 管理的模块化工程。
@@ -74,3 +81,9 @@ big-keeper 的出现就是为了解决这些问题。
74
81
 
75
82
  - [feature](FEATURE.md):功能开发流程;
76
83
  - [release](RELEASE.md):版本发布流程。
84
+
85
+ ## 协议
86
+
87
+ ![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png)
88
+
89
+ big-keeper 基于 MIT 协议进行分发和使用,更多信息参见协议文件。
@@ -2,7 +2,16 @@
2
2
 
3
3
  直接在命令行执行 `big-keeper release --help` 可以查看其提供的所有功能:
4
4
  ```
5
- // todo
5
+ NAME
6
+ release - Release operations
7
+
8
+ SYNOPSIS
9
+ big-keeper [global options] release home
10
+ big-keeper [global options] release module
11
+
12
+ COMMANDS
13
+ home - Release home project operations
14
+ module - Start release module
6
15
  ```
7
16
  全局参数如下:
8
17
 
@@ -10,11 +19,22 @@
10
19
 
11
20
  - -p, --path:项目路径名,默认是当前所在的路径
12
21
 
13
- - -v, --version:项目版本号,默认是当前所在的路径
22
+ - -v, --version:项目版本号,默认是当前所在的路径
14
23
 
15
24
  功能列表如下:
16
25
 
17
26
  - home: 发布主工程命令
18
27
  - start: 开始发布主工程的某个版本
19
- - finish:
28
+ - finish: 完成发布版本
20
29
  - module: 发布模块命令
30
+
31
+ ## release 的工作区
32
+ 同 feature 工作区
33
+
34
+ ## release home start 流程
35
+ ![](../../resources/readme/big-keeper-readme.008.jpeg)
36
+ ## release home finish 流程
37
+ ![](../../resources/readme/big-keeper-readme.009.jpeg)
38
+ ## release module 流程
39
+ ![](../../resources/readme/big-keeper-readme.010.jpeg)
40
+
data/lib/big_keeper.rb CHANGED
@@ -125,6 +125,7 @@ module BigKeeper
125
125
  home.command :start do |start|
126
126
  start.action do |global_options, options, args|
127
127
  help_now!('user name is required') if user and user.empty?
128
+ raise BigKeeperLog.error("release version is required") if version == nil
128
129
  release_home_start(path, version, user)
129
130
  end
130
131
  end
@@ -132,15 +133,17 @@ module BigKeeper
132
133
  home.desc 'Finish release home project'
133
134
  home.command :finish do |finish|
134
135
  finish.action do |global_options, options, args|
136
+ raise BigKeeperLog.error("release version is required") if version == nil
135
137
  release_home_finish(path, version)
136
138
  end
137
139
  end
138
140
  end
139
141
 
140
- c.desc 'Start release module'
142
+ c.desc 'release module'
141
143
  c.command :module do |finish|
142
144
  finish.action do |global_options, options, args|
143
145
  help_now!('module name is required') if args.length != 1
146
+ raise BigKeeperLog.error("release version is required") if version == nil
144
147
  module_name = args[0]
145
148
  start_module_release(path, version, user, module_name)
146
149
  end
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/ruby
2
+ require 'big_stash/stash_operator'
2
3
 
3
4
  module BigKeeper
4
5
  def self.feature_switch(path, version, user, name)
@@ -22,6 +23,9 @@ module BigKeeper
22
23
  GitOperator.new.git_checkout(path, branch_name)
23
24
  GitOperator.new.pull(path)
24
25
 
26
+ # Apply home stash
27
+ BigStash::StashOperator.new(path).pop_stash(branch_name)
28
+
25
29
  modules = PodfileOperator.new.modules_with_type("#{path}/Podfile",
26
30
  BigkeeperParser.module_names, ModuleType::PATH)
27
31
 
@@ -29,9 +33,6 @@ module BigKeeper
29
33
  ModuleService.new.switch(path, user, module_name, branch_name)
30
34
  end
31
35
 
32
- # Apply stash
33
- StashService.new.apply_stash(path, branch_name, user, modules)
34
-
35
36
  # pod install
36
37
  p `pod install --project-directory=#{path}`
37
38
 
@@ -3,37 +3,38 @@ require 'big_keeper/util/podfile_operator'
3
3
  require 'big_keeper/util/gitflow_operator'
4
4
  require 'big_keeper/model/podfile_type'
5
5
  require 'big_keeper/util/info_plist_operator'
6
+ require 'big_keeper/util/log_util'
6
7
 
7
8
  module BigKeeper
8
9
  def self.release_home_start(path, version, user)
9
10
  BigkeeperParser.parse("#{path}/Bigkeeper")
10
- start_release(path, version, BigkeeperParser::module_names, GitInfo.new(BigkeeperParser::home_git, GitType::TAG, version), user)
11
+ start_release(path, version, BigkeeperParser::module_names, user)
11
12
  end
12
13
 
13
14
  def self.release_home_finish(path, version)
14
15
  Dir.chdir(path) do
15
- if GitOperator.new.has_branch(project_path, "release/#{version}")
16
- if GitOperator.new.current_branch(project_path) != "release/#{version}"
16
+ if GitOperator.new.has_branch(path, "release/#{version}")
17
+ if GitOperator.new.current_branch(path) == "release/#{version}"
17
18
  GitOperator.new.commit(path, "release: V #{version}")
18
19
  GitOperator.new.push(path, "release/#{version}")
19
20
  GitflowOperator.new.finish_release(path, version)
20
- if GitOperator.new.current_branch(project_path) == "master"
21
+ if GitOperator.new.current_branch(path) == "master"
21
22
  GitOperator.new.tag(path, version)
22
23
  else
23
- GitOperator.new.git_checkout(project_path, "master")
24
+ GitOperator.new.git_checkout(path, "master")
24
25
  GitOperator.new.tag(path, version)
25
26
  end
26
27
  else
27
- raise "Not in release branch, please check your branches."
28
+ raise BigKeeperLog.error("Not in release branch, please check your branches.")
28
29
  end
29
30
  else
30
- raise "Not has release branch, use release start first."
31
+ raise BigKeeperLog.error("Not has release branch, please use release start first.")
31
32
  end
32
33
  end
33
34
  end
34
35
 
35
36
  private
36
- def self.start_release(project_path, version, modules, source, user)
37
+ def self.start_release(project_path, version, modules, user)
37
38
  Dir.chdir(project_path) do
38
39
  # step 0 Stash current branch
39
40
  StashService.new.stash(project_path, GitOperator.new.current_branch(project_path), user, modules)
@@ -51,8 +52,7 @@ module BigKeeper
51
52
  # step 2 replace_modules
52
53
  PodfileOperator.new.replace_all_module_release(%Q(#{project_path}/Podfile),
53
54
  modules,
54
- version,
55
- source)
55
+ version)
56
56
 
57
57
  # step 3 change Info.plist value
58
58
  InfoPlistOperator.new.change_version_build(project_path, version)
@@ -3,25 +3,68 @@ require 'big_keeper/util/podfile_operator'
3
3
  require 'big_keeper/util/gitflow_operator'
4
4
  require 'big_keeper/model/podfile_type'
5
5
  require 'big_keeper/util/info_plist_operator'
6
+ require 'big_keeper/util/git_operator'
7
+ require 'big_keeper/util/log_util'
6
8
 
7
9
  module BigKeeper
8
10
  def self.start_module_release(path, version, user, module_name)
9
- main_path = File.expand_path("#{path}/Example")
10
- module_release(main_path,
11
- version,
12
- BigkeeperParser::module_names,
13
- GitInfo.new(BigkeeperParser::home_git, GitType::TAG, version), user)
11
+ BigkeeperParser.parse("#{path}/Bigkeeper")
12
+ Dir.chdir(path) do
13
+ module_release(BigkeeperParser::module_path(user, module_name),
14
+ version,
15
+ module_name,
16
+ GitInfo.new(BigkeeperParser::home_git, GitType::TAG, version),
17
+ user)
18
+ end
14
19
  end
15
20
 
16
21
  private
17
- def self.module_release(project_path, version, module_name, source)
18
- Dir.chdir(project_path) do
19
- PodfileOperator.new.find_and_replace(%Q(#{project_path}/Podfile),
20
- module_name,
21
- ModuleType::GIT,
22
- source)
23
- p `pod install --project-directory=#{project_path}`
24
- p `open #{project_path}/*.xcworkspace`
22
+ def self.module_release(module_path, version, module_name, source, user)
23
+ Dir.chdir(module_path) do
24
+ if GitOperator.new.has_changes(module_path)
25
+ StashService.new.stash(module_path, GitOperator.new.current_branch(module_path), user, module_name.split())
26
+ end
27
+
28
+ # step 1 checkout release
29
+ if GitOperator.new.current_branch(module_path) != "release/#{version}"
30
+ if GitOperator.new.has_branch(module_path, "release/#{version}")
31
+ GitOperator.new.git_checkout(module_path, "release/#{version}")
32
+ else
33
+ GitflowOperator.new.start(module_path, version, GitflowType::RELEASE)
34
+ GitOperator.new.push(module_path, "release/#{version}")
35
+ end
36
+ end
37
+ p "path----"
38
+ puts GitOperator.new.current_branch(module_path)
39
+ #修改 podspec 文件
40
+ # TO DO: - advanced to use Regular Expression
41
+ has_error = false
42
+ IO.popen("pod lib lint --allow-warnings --verbose --use-libraries --sources=#{BigkeeperParser::sourcemodule_path}") do |io|
43
+ io.each do |line|
44
+ has_error = true if line.include? "ERROR"
45
+ end
46
+ end
47
+ if has_error
48
+ puts "error"
49
+ return
50
+ end
51
+
52
+ puts "error------"
53
+ # PodfileOperator.new.podspec_change(%Q(#{module_path}/#{module_name}.podspec), version, module_name)
54
+ # p `pod lib lint --allow-warnings --verbose --use-libraries --sources=#{BigkeeperParser::sourcemodule_path}`
55
+
56
+ # GitOperator.new.commit(module_path, "update podspec")
57
+ # GitOperator.new.push(module_path, GitOperator.new.current_branch(module_path))
58
+ # if GitOperator.new.current_branch(module_path) != "master"
59
+ # current_name = GitOperator.new.current_branch(module_path)
60
+ # p `git checkout master`
61
+ # p `git merge #{current_name}`
62
+ # p `git push`
63
+ # end
64
+ # GitOperator.new.tag(module_path, version)
65
+
66
+ # p `pod repo push #{module_name} #{module_name}.podspec --allow-warnings --sources=#{BigkeeperParser::sourcemodule_path}`
67
+
25
68
  end
26
69
  end
27
70
  end
@@ -36,6 +36,8 @@ module BigKeeper
36
36
  GitOperator.new.git_checkout(module_full_path, branch_name)
37
37
  GitOperator.new.pull(module_full_path)
38
38
  end
39
+
40
+ BigStash::StashOperator.new(module_full_path).pop_stash(branch_name)
39
41
  end
40
42
 
41
43
  def finish(path, user, module_name)
@@ -76,7 +78,7 @@ module BigKeeper
76
78
  GitService.new.start(module_full_path, name, type)
77
79
 
78
80
  # apply stash
79
- BigStash::StashOperator.new(module_full_path).apply_stash(branch_name)
81
+ BigStash::StashOperator.new(module_full_path).pop_stash(branch_name)
80
82
 
81
83
  module_path = BigkeeperParser.module_path(user, module_name)
82
84
  PodfileOperator.new.find_and_replace("#{path}/Podfile",
@@ -29,14 +29,14 @@ module BigKeeper
29
29
  end
30
30
  end
31
31
 
32
- def apply_stash(path, user, branch_name, modules)
32
+ def pop_stash(path, user, branch_name, modules)
33
33
  # Stash modules
34
34
  modules.each do |module_name|
35
35
  module_path = BigkeeperParser.module_full_path(path, user, module_name)
36
- BigStash::StashOperator.new(module_path).apply_stash(branch_name)
36
+ BigStash::StashOperator.new(module_path).pop_stash(branch_name)
37
37
  end
38
38
  # Stash home
39
- BigStash::StashOperator.new(path).apply_stash(branch_name)
39
+ BigStash::StashOperator.new(path).pop_stash(branch_name)
40
40
  end
41
41
  end
42
42
  end
@@ -22,6 +22,10 @@ module BigKeeper
22
22
  yield if block_given?
23
23
  end
24
24
 
25
+ def self.source(name)
26
+ BigkeeperParser.parse_source(name)
27
+ end
28
+
25
29
  # Bigkeeper file parser
26
30
  class BigkeeperParser
27
31
  @@config = {}
@@ -30,12 +34,12 @@ module BigKeeper
30
34
  def self.parse(bigkeeper)
31
35
  if @@config.empty?
32
36
  content = File.read bigkeeper
33
-
34
37
  content.gsub!(/version\s/, 'BigKeeper::version ')
35
38
  content.gsub!(/user\s/, 'BigKeeper::user ')
36
39
  content.gsub!(/home\s/, 'BigKeeper::home ')
37
40
  content.gsub!(/pod\s/, 'BigKeeper::pod ')
38
41
  content.gsub!(/modules\s/, 'BigKeeper::modules ')
42
+ content.gsub!(/source\s/, 'BigKeeper::source ')
39
43
  eval content
40
44
  # p @@config
41
45
  end
@@ -45,6 +49,13 @@ module BigKeeper
45
49
  @@config[:version] = name
46
50
  end
47
51
 
52
+ def self.parse_source(name)
53
+ sources = []
54
+ sources << @@config[:source]
55
+ sources << name
56
+ @@config[:source] = sources
57
+ end
58
+
48
59
  def self.parse_user(name)
49
60
  @@current_user = name
50
61
  users = @@config[:users]
@@ -106,6 +117,10 @@ module BigKeeper
106
117
  @@config[:home][:pulls]
107
118
  end
108
119
 
120
+ def self.sourcemodule_path
121
+ @@config[:source].join(",").reverse.chop.reverse
122
+ end
123
+
109
124
  def self.module_full_path(home_path, user_name, module_name)
110
125
  if @@config[:users] \
111
126
  && @@config[:users][user_name] \
@@ -84,36 +84,13 @@ module BigKeeper
84
84
  end
85
85
  end
86
86
 
87
- def replace_all_module_release(podfile, module_names, version, source)
88
-
87
+ def replace_all_module_release(podfile, module_names, version)
89
88
  module_names.each do |module_name|
90
89
  PodfileOperator.new.find_and_replace(podfile,
91
90
  module_name,
92
91
  ModuleType::GIT,
93
- source)
92
+ GitInfo.new(BigkeeperParser.module_git(module_name), GitType::TAG, version))
94
93
  end
95
-
96
-
97
-
98
- # temp_file = Tempfile.new('.Podfile.tmp')
99
- # begin
100
- # File.open(podfile, 'r') do |file|
101
- # file.each_line do |line|
102
- # module_names.each do |module_name|
103
- # if line.include?module_name
104
- # temp_file.puts generate_module_config(module_name, ModuleType::GIT, source)
105
- # else
106
- # # temp_file.puts line
107
- # end
108
- # end
109
- # end
110
- # end
111
- # temp_file.close
112
- # FileUtils.mv(temp_file.path, podfile)
113
- # ensure
114
- # temp_file.close
115
- # temp_file.unlink
116
- # end
117
94
  end
118
95
 
119
96
  def find_and_lock(podfile,dictionary)
@@ -137,6 +114,32 @@ module BigKeeper
137
114
  temp_file.unlink
138
115
  end
139
116
  end
117
+
118
+ def podspec_change(podspec_file, version, module_name)
119
+ temp_file = Tempfile.new(".#{module_name}.podspec")
120
+ begin
121
+ File.open(podspec_file, 'r') do |file|
122
+ file.each_line do |line|
123
+ if line.include?("s.version")
124
+ temp_line = line
125
+ if temp_line.split("=")[0].delete(" ") == "s.version"
126
+ temp_file.puts "s.version = '#{version}'"
127
+ else
128
+ temp_file.puts line
129
+ end
130
+ else
131
+ temp_file.puts line
132
+ end
133
+ end
134
+ end
135
+ temp_file.close
136
+ FileUtils.mv(temp_file.path, podspec_file)
137
+ ensure
138
+ temp_file.close
139
+ temp_file.unlink
140
+ end
141
+ end
142
+
140
143
  private :generate_module_config,:generate_pod_config
141
144
  end
142
145
  end
@@ -1,3 +1,3 @@
1
1
  module BigKeeper
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: big_keeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-10 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -202,10 +202,14 @@ executables:
202
202
  extensions: []
203
203
  extra_rdoc_files: []
204
204
  files:
205
+ - ".github/ISSUE_TEMPLATE.md"
205
206
  - ".gitignore"
207
+ - ".travis.yml"
208
+ - CODE_OF_CONDUCT.md
209
+ - CONTRIBUTING.md
206
210
  - Gemfile
207
211
  - Gemfile.lock
208
- - LICENSE.txt
212
+ - LICENSE
209
213
  - README.md
210
214
  - Rakefile
211
215
  - big_keeper.gemspec
@@ -250,6 +254,9 @@ files:
250
254
  - resources/readme/big-keeper-readme.005.png
251
255
  - resources/readme/big-keeper-readme.006.png
252
256
  - resources/readme/big-keeper-readme.007.png
257
+ - resources/readme/big-keeper-readme.008.jpeg
258
+ - resources/readme/big-keeper-readme.009.jpeg
259
+ - resources/readme/big-keeper-readme.010.jpeg
253
260
  homepage: https://github.com/BigKeeper/big-keeper
254
261
  licenses:
255
262
  - MIT