radon 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +53 -18
- data/data/c.b64 +15 -0
- data/data/c.zip +0 -0
- data/img/demo.gif +0 -0
- data/img/radon-readme-header.png +0 -0
- data/lib/core/constants.rb +1 -1
- data/lib/core/environments.rb +5 -2
- data/lib/core/extract.rb +5 -1
- data/pkg/radon-0.1.1.gem +0 -0
- data/scripts/build_install_local.sh +9 -0
- data/scripts/release_and_build.sh +34 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b5548f1fd48f84404e4e34a57b27dbc5afbe992
|
4
|
+
data.tar.gz: 91574ca256bc4543cdb9475b06744b81c3baee3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc1b7026e02a902b15251d7723631a3ac734bb789173ca9b1747635c5404c194293a1d8e6f18688f0711c384c3152b3e88b19cb14c75940a8b29f15edb39a81
|
7
|
+
data.tar.gz: a1d757d76624003c129b7583c9f5012ea7037b106c310d79f5fec97b91510a774924775859a6e95049666b85cd8e742212bf9bc4a4dd7cafddbdd9a2b3b94d13
|
data/README.md
CHANGED
@@ -1,34 +1,69 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/radon`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/cbrnrd/radon/master/img/radon-readme-header.png"></p>
|
2
|
+
<p align="center"><img src="https://raw.githubusercontent.com/cbrnrd/radon/master/img/demo.gif"></p>
|
6
3
|
|
7
4
|
## Installation
|
8
5
|
|
9
|
-
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'radon'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
6
|
+
`radon` is part of the [periodic](https://periodic.now.sh) collection of apps. If you install `periodic-cli`, radon should come with it:
|
16
7
|
|
17
|
-
$
|
8
|
+
$ gem install periodic-cli
|
18
9
|
|
19
|
-
Or install
|
10
|
+
Or install just the gem:
|
20
11
|
|
21
12
|
$ gem install radon
|
22
13
|
|
23
14
|
## Usage
|
24
15
|
|
25
|
-
|
16
|
+
The basic usage is as follows: `radon [environment] {ProjectName}`.
|
26
17
|
|
27
|
-
|
18
|
+
A full list of supported environments can be found by running `radon --list-env`
|
28
19
|
|
29
|
-
|
20
|
+
#### Example:
|
21
|
+
|
22
|
+
Here is radon generating a gradle project called MyGradleProject
|
23
|
+
```
|
24
|
+
$ radon gradle MyGradleProject
|
25
|
+
Creating project under /mnt/c/Users/Carter/Desktop/projects/MyGradleProject
|
26
|
+
create MyGradleProject
|
27
|
+
create MyGradleProject/.gradle/
|
28
|
+
create MyGradleProject/.gradle/4.5/
|
29
|
+
create MyGradleProject/.gradle/4.5/fileChanges/
|
30
|
+
create MyGradleProject/.gradle/4.5/fileChanges/last-build.bin
|
31
|
+
create MyGradleProject/.gradle/4.5/fileHashes/
|
32
|
+
create MyGradleProject/.gradle/4.5/fileHashes/fileHashes.bin
|
33
|
+
create MyGradleProject/.gradle/4.5/fileHashes/fileHashes.lock
|
34
|
+
create MyGradleProject/.gradle/4.5/taskHistory/
|
35
|
+
create MyGradleProject/.gradle/4.5/taskHistory/taskHistory.bin
|
36
|
+
create MyGradleProject/.gradle/4.5/taskHistory/taskHistory.lock
|
37
|
+
create MyGradleProject/.gradle/buildOutputCleanup/
|
38
|
+
create MyGradleProject/.gradle/buildOutputCleanup/buildOutputCleanup.lock
|
39
|
+
create MyGradleProject/.gradle/buildOutputCleanup/cache.properties
|
40
|
+
create MyGradleProject/.gradle/buildOutputCleanup/outputFiles.bin
|
41
|
+
create MyGradleProject/build.gradle
|
42
|
+
create MyGradleProject/gradle/
|
43
|
+
create MyGradleProject/gradle/wrapper/
|
44
|
+
create MyGradleProject/gradle/wrapper/gradle-wrapper.jar
|
45
|
+
create MyGradleProject/gradle/wrapper/gradle-wrapper.properties
|
46
|
+
create MyGradleProject/gradlew
|
47
|
+
create MyGradleProject/gradlew.bat
|
48
|
+
create MyGradleProject/settings.gradle
|
49
|
+
create MyGradleProject/src/
|
50
|
+
create MyGradleProject/src/main/
|
51
|
+
create MyGradleProject/src/main/java/
|
52
|
+
create MyGradleProject/src/main/test/
|
53
|
+
Done! Your project is set up in /mnt/c/Users/Carter/Desktop/projects/MyGradleProject.
|
54
|
+
```
|
55
|
+
|
56
|
+
## Development
|
30
57
|
|
31
|
-
|
58
|
+
#### Adding an environment
|
59
|
+
If you want to add an environment to radon, here are the steps:
|
60
|
+
1. Create the standard directory structure of that environment. This is usually found on the environment's website or just through convention.
|
61
|
+
2. Zip all the files into one file (`zip -r env.zip .`)
|
62
|
+
3. Save the zip data as base64 (`cat env.zip | base64 -w 0 > env.b64`)
|
63
|
+
4. Put both the base64 data and the zip file in radon's `/data` folder.
|
64
|
+
5. Add the function(s) in `extract.rb` to extract the _zip_ file to the target (See [here](https://github.com/cbrnrd/radon/blob/7cd141b5a61de6a8abaf0009a1a8cfd090f05e97/lib/core/extract.rb#L5))
|
65
|
+
6. Add the environments to `@@all` in `environments.rb`
|
66
|
+
7. Open a pull request
|
32
67
|
|
33
68
|
## Contributing
|
34
69
|
|
data/data/c.b64
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
UEsDBBQAAAAIAFpvWU2pW4/NuwAAABkBAAAIABwATWFrZWZpbGVVVAkAA1wE0ltcBNJbdXgLAAEE
|
2
|
+
6AMAAAToAwAAbY7LCsIwEEXXzlfMIkKrJO6DATX1BaLSIsWVxCQthZpCqyB+vbUP6MLNLOY+zpVS
|
3
|
+
pFqD3ByW20jQWOU50ti+n6WCYL26bG+9lKbmjjSplMue2ccKZUxpq2r4ejljk8xZAxCF8hbsQ1GV
|
4
|
+
GqAu5fhQmQMw9v5KObalU0G8IcTv5ToAMGYFciReV+XPxkzDiHhS+kh1LXQhJHOkBZIFwI/RkljR
|
5
|
+
W//52Hl3Ol456twqB83lMKLlAyc1tFn6BVBLAwQKAAAAAABrb1lNAAAAAAAAAAAAAAAACQAcAFJF
|
6
|
+
QURNRS5tZFVUCQADegTSW3oE0lt1eAsAAQToAwAABOgDAABQSwMECgAAAAAAO29ZTQAAAAAAAAAA
|
7
|
+
AAAAAAQAHABzcmMvVVQJAAMiBNJbMZHUW3V4CwABBOgDAAAE6AMAAFBLAwQUAAAACADqbVlNyEns
|
8
|
+
m0QAAABGAAAACgAcAHNyYy9tYWluLmNVVAkAA6gB0luoAdJbdXgLAAEE6AMAAAToAwAAU87MS84p
|
9
|
+
TUlVsCkuScnM18uw4+LKzCtRyE3MzFPQALESi9KTdRSSMxKLFLSA7LLoWE2uai4uzqLUktKiPAUD
|
10
|
+
a65aLgBQSwECHgMUAAAACABab1lNqVuPzbsAAAAZAQAACAAYAAAAAAABAAAApIEAAAAATWFrZWZp
|
11
|
+
bGVVVAUAA1wE0lt1eAsAAQToAwAABOgDAABQSwECHgMKAAAAAABrb1lNAAAAAAAAAAAAAAAACQAY
|
12
|
+
AAAAAAAAAAAApIH9AAAAUkVBRE1FLm1kVVQFAAN6BNJbdXgLAAEE6AMAAAToAwAAUEsBAh4DCgAA
|
13
|
+
AAAAO29ZTQAAAAAAAAAAAAAAAAQAGAAAAAAAAAAQAO1BQAEAAHNyYy9VVAUAAyIE0lt1eAsAAQTo
|
14
|
+
AwAABOgDAABQSwECHgMUAAAACADqbVlNyEnsm0QAAABGAAAACgAYAAAAAAABAAAApIF+AQAAc3Jj
|
15
|
+
L21haW4uY1VUBQADqAHSW3V4CwABBOgDAAAE6AMAAFBLBQYAAAAABAAEADcBAAAGAgAAAAA=
|
data/data/c.zip
ADDED
Binary file
|
data/img/demo.gif
ADDED
Binary file
|
Binary file
|
data/lib/core/constants.rb
CHANGED
data/lib/core/environments.rb
CHANGED
@@ -6,7 +6,8 @@ class Environments
|
|
6
6
|
'java' => File.join(DATA_DIR, "java.zip"),
|
7
7
|
'maven' => File.join(DATA_DIR, "maven.zip"),
|
8
8
|
'python' => File.join(DATA_DIR, "python.zip"),
|
9
|
-
'ruby (beta)' => File.join(DATA_DIR, "ruby.zip")
|
9
|
+
'ruby (beta)' => File.join(DATA_DIR, "ruby.zip"),
|
10
|
+
'c' => File.join(DATA_DIR, "c.zip")
|
10
11
|
}
|
11
12
|
|
12
13
|
# Gets all environments as an array of strings
|
@@ -31,9 +32,11 @@ class Environments
|
|
31
32
|
extract_ruby(target)
|
32
33
|
when 'maven'
|
33
34
|
extract_maven(target)
|
35
|
+
when 'c'
|
36
|
+
extract_c(target)
|
34
37
|
else
|
35
38
|
error("#{key} is not a supported environment.\nYou can suggest it be added at https://github.com/cbrnrd/radon/issues")
|
36
39
|
end
|
37
40
|
end
|
38
41
|
end
|
39
|
-
end
|
42
|
+
end
|
data/lib/core/extract.rb
CHANGED
@@ -23,6 +23,10 @@ def extract_ruby(target)
|
|
23
23
|
find_and_replace_all(target, '{{NAME}}', projectify(target).split('-').collect(&:capitalize).join)
|
24
24
|
end
|
25
25
|
|
26
|
+
def extract_c(target)
|
27
|
+
extract_zip(Radon::Environments.getTargetOf('c'), target)
|
28
|
+
end
|
29
|
+
|
26
30
|
# Extracts some zip data to the passed destination
|
27
31
|
def extract_zip(file, destination)
|
28
32
|
puts "Creating project under #{File.expand_path(destination)}" unless $quiet
|
@@ -41,4 +45,4 @@ def extract_zip(file, destination)
|
|
41
45
|
zip_file.extract(f, fpath) unless File.exist?(fpath)
|
42
46
|
end
|
43
47
|
end
|
44
|
-
end
|
48
|
+
end
|
data/pkg/radon-0.1.1.gem
CHANGED
Binary file
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
cd ..
|
4
|
+
|
5
|
+
CURRENT_VERSION=$(cat lib/core/constants.rb | grep VERSION | cut -d '"' -f 2)
|
6
|
+
|
7
|
+
TO_UPDATE=(
|
8
|
+
lib/core/constants.rb
|
9
|
+
)
|
10
|
+
|
11
|
+
echo -n "Current version is $CURRENT_VERSION, select new version: "
|
12
|
+
read NEW_VERSION
|
13
|
+
echo "Creating v$NEW_VERSION...\n"
|
14
|
+
|
15
|
+
for file in "${TO_UPDATE[@]}"
|
16
|
+
do
|
17
|
+
echo "Patching $file ..."
|
18
|
+
sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g" $file
|
19
|
+
git add $file
|
20
|
+
done
|
21
|
+
|
22
|
+
|
23
|
+
git commit -m "Releasing v$NEW_VERSION"
|
24
|
+
git push
|
25
|
+
|
26
|
+
git tag -a v$NEW_VERSION -m "Release v$NEW_VERSION"
|
27
|
+
git push origin v$NEW_VERSION
|
28
|
+
|
29
|
+
echo
|
30
|
+
echo "Version $NEW_VERSION pushed to GitHub. Building gem and pushing to RubyGems now..."
|
31
|
+
|
32
|
+
gem build radon.gemspec
|
33
|
+
|
34
|
+
gem push radon-$NEW_VERSION.gem
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cbrnrd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paint
|
@@ -101,6 +101,8 @@ files:
|
|
101
101
|
- bin/console
|
102
102
|
- bin/radon
|
103
103
|
- bin/setup
|
104
|
+
- data/c.b64
|
105
|
+
- data/c.zip
|
104
106
|
- data/gradle.b64
|
105
107
|
- data/gradle.zip
|
106
108
|
- data/java.b64
|
@@ -111,6 +113,8 @@ files:
|
|
111
113
|
- data/python.zip
|
112
114
|
- data/ruby.b64
|
113
115
|
- data/ruby.zip
|
116
|
+
- img/demo.gif
|
117
|
+
- img/radon-readme-header.png
|
114
118
|
- lib/core.rb
|
115
119
|
- lib/core/constants.rb
|
116
120
|
- lib/core/environments.rb
|
@@ -118,6 +122,8 @@ files:
|
|
118
122
|
- lib/core/text.rb
|
119
123
|
- pkg/radon-0.1.1.gem
|
120
124
|
- radon.gemspec
|
125
|
+
- scripts/build_install_local.sh
|
126
|
+
- scripts/release_and_build.sh
|
121
127
|
homepage: https://github.com/cbrnrd/radon
|
122
128
|
licenses:
|
123
129
|
- MIT
|
@@ -138,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
144
|
version: '0'
|
139
145
|
requirements: []
|
140
146
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.6.
|
147
|
+
rubygems_version: 2.6.14
|
142
148
|
signing_key:
|
143
149
|
specification_version: 4
|
144
150
|
summary: Radon generates starter code for all kinds of environments.
|