Skip to content

Commit 206ee87

Browse files
committed
Merge branch 'release-0.1.4'
2 parents 70cb924 + 8a38fbf commit 206ee87

File tree

5 files changed

+179
-233
lines changed

5 files changed

+179
-233
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,36 @@
33
Contributions to staruml-ruby are very welcome. Please, have a look through the
44
guidelines in this file before submitting an issue or a pull request.
55

6-
## Using issues
6+
## Issues
77

8-
Use the [issue tracker][issuetracker] for reporting bugs, requesting new features,
9-
and discussing. If you want to submit an issue,
8+
Use the [issue tracker][issuetracker] for reporting bugs, requesting new
9+
features, and discussing. If you want to submit an issue,
1010

11-
* check the issue search first to prevent double submission of issues.
11+
* search the issue first to prevent double submission of issues.
1212
* the issue detail should be written clearly.
1313

1414
## Pull requests
1515

1616
Follow these guidelines below.
1717

18-
* use soft tabs set to 2 spaces.
19-
* test your code first to make sure your code is working properly.
20-
* commit message should contain what you changed (explain it clearly and capitalize
21-
its first letter).
22-
* choose `dev` branch as your target branch (don't choose `master` branch).
18+
* use soft tabs that set to 2 spaces for the code.
19+
* test your code first to make sure the code is working properly.
20+
* commit message should contain what you changed.
21+
* choose `dev` branch as your target branch.
2322
* the pull request detail should be written for additional details.
2423

2524
## Useful Links
2625

27-
Here below are some useful links for developing StarUML extension.
26+
Here below are some useful links for developing a StarUML extension.
2827

2928
* [StarUML main page][staruml]
3029
* [StarUML developer's guide][starumldev]
3130
* [StarUML API reference][starumlapi]
3231

3332
## License
3433

35-
By contributing your code, you agree to license your contribution under the terms
36-
of the [MIT License][license].
34+
By contributing your code, you agree to license your contribution under the
35+
terms of the [MIT License][license].
3736

3837
[issuetracker]: https://github.com/meisyal/staruml-ruby/issues
3938
[staruml]: http://staruml.io

README.md

Lines changed: 44 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,81 @@
11
# staruml-ruby
22

3-
staruml-ruby is a Ruby extension for [StarUML][staruml] 2. This extension helps you
4-
to generate Ruby code from a UML class diagram.
5-
6-
## Installation
7-
8-
There are several ways to install this extension. You can install manually, via
9-
StarUML extension repository, or via URL. **I strongly recommend installing via
10-
StarUML extension repository**.
11-
12-
### Manual
13-
14-
If you prefer to install manually. Please, follow these steps below.
15-
16-
1. Download the latest package of staruml-ruby [here][release].
17-
2. Create a new folder `meisyal.starumlruby` in this location. Location depends on
18-
your operating system.
19-
20-
* Linux: `~/.config/StarUML/extensions/user`
21-
* Mac OS: `~/Library/Application Support/StarUML/extensions/user`
22-
* Windows: `C:\Users\<user>\AppData\Roaming\StarUML\extensions\user`
23-
24-
3. Extract the package in the new extension folder.
25-
4. Open or restart StarUML if you have already opened it.
26-
27-
Internet connection is needed before installing extension via StarUML extension
28-
repository or URL.
29-
30-
### via StarUML extension repository
31-
32-
Open the StarUML extension manager (**Tools** -> **Extension Manager...**) and
33-
install the Ruby extension. I recommend this installation method because it is
34-
going to install the stable version of the extension. Beside that, the installed
35-
extension is from StarUML extension repository (it means the extension is officially
36-
registered).
37-
38-
### via URL
39-
40-
Follow these steps below.
41-
42-
1. Open the StarUML extension manager (**Tools** -> **Extension Manager...**).
43-
2. Select **Install From URL...** button in the bottom left corner of the pop
44-
window.
45-
3. Enter the following URL `https://github.com/meisyal/staruml-ruby`.
46-
4. Open or restart StarUML if you are already opening it.
47-
48-
At last, open the StarUML extension manager (**Tools** -> **Extension Manager...**)
49-
and then click **Installed** tab to make sure this extension is successfully
50-
installed.
3+
staruml-ruby is a Ruby extension for [StarUML][staruml] 2. This extension helps
4+
you to generate Ruby code from a UML class diagram.
515

526
## Current Status
537

548
This extension currently supports generating Ruby code from a UML class diagram.
9+
Reverse engineering from Ruby code to a UML class diagram is not supported at
10+
the moment.
5511

56-
### Supported UML Concepts
57-
58-
This tool supports StarUML model below.
59-
60-
**Classes**
61-
62-
* tool will generate a separated `.rb` file that contains a Ruby class.
63-
* the generated file name will be `snake_case.rb` (file name refers to the name of
64-
Ruby class).
65-
* constructor is generated by default (`def initialize` method).
66-
* a to string instance method is generated by default (`def to_s` method).
67-
* code documentation will be generated at the top of class name.
12+
Please, refer to [Supported UML concepts][umlconcept] page for futher details.
6813

69-
**Attributes of clasess**
70-
* methods for set and get attributes are generated by default (it doesn't use
71-
`attr_accessor :an_attribute`).
72-
* methods for set and get attributes are grouped by theirs visibility. Same
73-
condition is applied for attribute accessor.
74-
* code documentation will be generated at the top of attribute accessor
75-
declaration if it uses attribute accessor rather than set and get attributes.
76-
77-
**Methods of classes**
78-
79-
* tool will generate a grouped method based on its visibility (`public`,
80-
`protected`, and `private` methods).
81-
* the generated method name is same as your method name in the model.
82-
* code documentation will be generated at the top of method name.
83-
84-
**Method Parameters**
85-
86-
tool will generate method parameters.
14+
## Installation
8715

88-
**Generalization**
16+
The simplest way to install staruml-ruby is from StarUML extension repository.
17+
This installation method is explained as follows:
8918

90-
* tool will generate a separated `.rb` file that contains an inheritance class.
91-
* the generated class name will be `class DerivedClass < BaseClass`.
92-
* constructor and a to string instance method are generated by default.
19+
1. Click **Tools** -> **Extension Manager...** on the menu bar of StarUML.
20+
The Extension Manager window will appear as a pop-up window.
21+
2. Select **Registry** button.
22+
3. Type `ruby` on search box. Ruby extension will appear.
23+
4. Press **Install** button of Ruby extension.
9324

94-
**Packages**
25+
Note that internet connection is needed to perfom the installation.
9526

96-
* tool will convert to Ruby module (as a folder with name `packagename`
97-
folder).
98-
* the `packagename` folder contains classes that belong to the package.
99-
* code documentation will be generated at the top of package name.
27+
StarUML extension repository stores extensions that officially registered.
28+
Because of it, I **highly recommend** to use this installation method.
29+
Registered extensions are available on [this page][starumlextension].
10030

101-
**Constants**
31+
See [Installation][installation] for other installation methods.
10232

103-
* tool will generate constants.
104-
* the constants support public and private constants.
33+
## Usage
10534

106-
## How to use this extension
35+
When this extension is successfully installed, it's time to use the extension.
36+
Prepare your model that contains a UML class diagram and then:
10737

108-
Please, follow these steps below.
38+
1. Click **Tools** -> **Ruby** -> **Generate Code...** on the menu bar of
39+
StarUML. A pop-up window will appear.
40+
2. Choose a model that will be generated its code. And then, press **OK**
41+
button.
42+
3. Select a location where the generated code will be stored.
43+
4. Press **Open** button.
10944

110-
1. Click the menu (**Tools** -> **Ruby** -> **Generate Code...**).
111-
2. Select a model which will be generated its code in the pop window. And then,
112-
click **OK**.
113-
3. Select a location where the generated code will be saved.
114-
4. The generated code will be saved in the place where you selected before.
45+
Your Ruby code is generated. :yay:
11546

116-
## How to configure this extension
47+
## Configuration
11748

118-
You can configure the extension before generating the code.
49+
You can configure the extension before generating the code. The configuration
50+
handles how the generated code looks like. Indentation of code and code comment,
51+
for example. This is supported by this extension to generate Ruby code, as
52+
you prefer.
11953

120-
1. Click the menu (**Tools** -> **Ruby** -> **Configure...**).
121-
2. Manage the configuration for code generation (there are some options there). You
122-
can always restore default configurations.
123-
3. Click **Close** when you have configured it.
54+
Check [Configuration][configuration] to configure the extension.
12455

12556
## Documentation
12657

12758
Documentation is available at [staruml-ruby GitHub Wiki][wiki]. Documentation
128-
contains a lot more detail on examples, use and features, and roadmap.
59+
contains a lot more detail on examples, features, and roadmap.
12960

13061
## Contributing
13162

132-
Before submitting an issue or a pull request, please take a moment to look over
133-
the [contributing guidelines][contributing] first.
63+
Contributions are welcome. Before submitting an issue or a pull request, please
64+
take a moment to look over the [contributing guidelines][contributing] first.
13465

13566
## License
13667

137-
This extension is released under the terms of MIT License. See the [LICENSE][license]
138-
file for more details.
68+
This extension is released under the terms of MIT License. See the
69+
[LICENSE][license] file for more details.
13970

14071
Copyright &copy; 2016 Andrias Meisyal.
14172

14273
[staruml]: http://staruml.io
143-
[release]: https://github.com/meisyal/staruml-ruby/releases
74+
[umlconcept]:
75+
https://github.com/meisyal/staruml-ruby/wiki/Supported-UML-Concepts
76+
[starumlextension]: http://staruml.io/extensions
77+
[installation]: https://github.com/meisyal/staruml-ruby/wiki/Installation
78+
[configuration]: https://github.com/meisyal/staruml-ruby/wiki/Configuration
14479
[wiki]: https://github.com/meisyal/staruml-ruby/wiki
14580
[contributing]:
14681
https://github.com/meisyal/staruml-ruby/blob/master/CONTRIBUTING.md

code-generator-utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,11 @@ define(function (require, exports, module) {
3131
return className.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
3232
};
3333

34+
CodeWriter.prototype.toCamelCase = function (className) {
35+
return className.replace(/(\b|_)\w/g, function (match) {
36+
return match.replace(/_/, '').toUpperCase();
37+
});
38+
};
39+
3440
exports.CodeWriter = CodeWriter;
3541
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"homepage": "https://github.com/meisyal/staruml-ruby",
66
"issues": "https://github.com/meisyal/staruml-ruby/issues",
77
"keywords": ["ruby"],
8-
"version": "0.1.3",
8+
"version": "0.1.4",
99
"author": {
1010
"name": "Andrias Meisyal",
1111
"email": "[email protected]",

0 commit comments

Comments
 (0)