clean-idea 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -32
- data/clean-idea.gemspec +5 -2
- data/lib/clean-idea/version.rb +1 -1
- data/lib/idea.rb +49 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a7db2b35e741eda1816a6a662b49329c94f27e3
|
4
|
+
data.tar.gz: ce82b5b736f97f4a03542fb1deb439214bc437e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 059b3bd9283eff57dd42a1072f32fec568eced93fef75aa2071f7d1d49cce4f2e18db5e95617a9fd5fecdcb3e99eb4dbb3468f634c7f5d167c5e1db460edd7e1
|
7
|
+
data.tar.gz: 040af18ad0c5cb567fe20e79d79d5e43df8264feb24f445bf7b4a6b1ef96811b4cc1cfb11d6729343637a8a0b705a2090c82f0dc64ff433a9cddc86a33cac986
|
data/README.md
CHANGED
@@ -1,41 +1,12 @@
|
|
1
|
-
# Clean
|
1
|
+
# Clean-Idea
|
2
|
+
[![Build Status](https://travis-ci.org/cesarferreira/clean-idea.svg?branch=master)](https://travis-ci.org/cesarferreira/clean-idea) [![Gem Version](https://badge.fury.io/rb/clean-idea.svg)](http://badge.fury.io/rb/clean-idea)
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
4
|
+
> Clean up the intellij Android studio files, all the `.idea/` and `*.iml`.. GONE!
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'clean-idea'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
8
|
$ gem install clean-idea
|
22
9
|
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/clean-idea. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
|
-
|
37
|
-
|
38
10
|
## License
|
39
11
|
|
40
12
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/clean-idea.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["cesarferreira"]
|
10
10
|
spec.email = ["cesar.manuel.ferreira@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{Clean up the intellij Android studio files }
|
13
|
+
spec.description = %q{Clean up the intellij Android studio files }
|
14
14
|
spec.homepage = "https://github.com/cesarferreira/clean-idea"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
@@ -19,8 +19,11 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
+
spec.required_ruby_version = '>= 2.0.0'
|
23
|
+
|
22
24
|
spec.add_development_dependency "bundler", "~> 1.10"
|
23
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.2'
|
24
27
|
spec.add_development_dependency "rspec"
|
25
28
|
|
26
29
|
spec.add_dependency 'colorize', '~> 0.7'
|
data/lib/clean-idea/version.rb
CHANGED
data/lib/idea.rb
CHANGED
@@ -1,8 +1,56 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
require 'fileutils'
|
3
|
+
|
1
4
|
module Clean
|
2
5
|
module Idea
|
3
6
|
class Manager
|
4
7
|
def initialize(arguments)
|
5
|
-
puts "
|
8
|
+
puts "Let the wipe begin....".yellow
|
9
|
+
|
10
|
+
if !is_android_project?
|
11
|
+
puts "but.. but... this isn't even an android project!".red
|
12
|
+
exit
|
13
|
+
end
|
14
|
+
|
15
|
+
ideas = get_all_idea_folders
|
16
|
+
imls = get_all_imls
|
17
|
+
|
18
|
+
if ideas.empty? && imls.empty?
|
19
|
+
puts "You have nothing to clean, cool!!".green
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
|
23
|
+
# wipe them all
|
24
|
+
delete_them_all ideas
|
25
|
+
delete_them_all imls
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
def delete_them_all array
|
31
|
+
return nil if !array
|
32
|
+
|
33
|
+
array.each do |item|
|
34
|
+
delete item
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def delete(item)
|
39
|
+
puts "Deleting: #{item.green}"
|
40
|
+
FileUtils.rm_f(item) if File.exist?(item)
|
41
|
+
FileUtils.remove_dir(item) if File.directory?(item)
|
42
|
+
end
|
43
|
+
|
44
|
+
def get_all_idea_folders
|
45
|
+
Dir.glob("#{Dir.pwd}/**/.idea/")
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_all_imls
|
49
|
+
Dir.glob("#{Dir.pwd}/**/*.iml")
|
50
|
+
end
|
51
|
+
|
52
|
+
def is_android_project?
|
53
|
+
File.exists?("#{Dir.pwd}/settings.gradle")
|
6
54
|
end
|
7
55
|
end
|
8
56
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clean-idea
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cesarferreira
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry-byebug
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rspec
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +80,7 @@ dependencies:
|
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0.7'
|
69
|
-
description:
|
83
|
+
description: 'Clean up the intellij Android studio files '
|
70
84
|
email:
|
71
85
|
- cesar.manuel.ferreira@gmail.com
|
72
86
|
executables:
|
@@ -97,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
111
|
requirements:
|
98
112
|
- - ">="
|
99
113
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
114
|
+
version: 2.0.0
|
101
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
116
|
requirements:
|
103
117
|
- - ">="
|
@@ -108,5 +122,5 @@ rubyforge_project:
|
|
108
122
|
rubygems_version: 2.4.8
|
109
123
|
signing_key:
|
110
124
|
specification_version: 4
|
111
|
-
summary:
|
125
|
+
summary: Clean up the intellij Android studio files
|
112
126
|
test_files: []
|