sf_cli 1.0.0.beta4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +17 -0
- data/lib/sf_cli/console/commands.rb +7 -8
- data/lib/sf_cli/sf/project/core.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c83fc3297315182771f73c3ff599bfdd9abcff1c72a401d69bc8a734e9c7cd17
|
4
|
+
data.tar.gz: 8ed2425d43258abcc43e7ba9ec0dadf1cc18474d47ea286b38998b564cd68e6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f97ab229a3000ac570e2d46ccaf393a6f64fd5717587449dede15c149286624b2b37356f7ef5bbe23772a8e8f14519d291b3addfab0114b5963c5831d7f3d604
|
7
|
+
data.tar.gz: fb431e461147f16d9a2bac7cf13970f011dc53d77f936dd09a60ed47b2b28259722c3457f435136bfae03673d4bb8df6099ff234852fd03d16c221cf284fe481
|
data/README.rdoc
CHANGED
@@ -63,3 +63,20 @@ With sf command:
|
|
63
63
|
Doing the same thing independently:
|
64
64
|
contact = Contact.select(:Id, :Name).where(Name: 'Akin Kristen').take
|
65
65
|
contact.Name # Akin Kristen
|
66
|
+
== Developer Console
|
67
|
+
Developer console integrates both sf_cli's command methods and object model librry into IRB to make scripting easier in REPL.
|
68
|
+
|
69
|
+
You can directly use sf_cli's command methods:
|
70
|
+
$ sf_cli
|
71
|
+
> sf.query "SELECT Id, Name FROM Case", target_org: :your_org
|
72
|
+
|
73
|
+
Object Model is also available:
|
74
|
+
> use :your_org_name
|
75
|
+
> gen :Account, :Contact, :User #=> generate 3 Object model classes
|
76
|
+
> acc = Account.find_by Name: 'Hoge Fuga'
|
77
|
+
|
78
|
+
There are some other console commands:
|
79
|
+
> query "SELECT Id, Name, ... FROM BazBar__c" # just same as `sf data query` with human readable format
|
80
|
+
> apex "System.debug('abc');" # execute Apex code instantly
|
81
|
+
|
82
|
+
Type `help` for the help of all console commands
|
@@ -10,12 +10,11 @@ module SfCli
|
|
10
10
|
# Developer Console commands
|
11
11
|
#
|
12
12
|
module Commands
|
13
|
-
def use(
|
14
|
-
target_org = _target_org.to_sym == :default ? nil : _target_org
|
13
|
+
def use(target_org)
|
15
14
|
org_info = sf.org.display target_org: target_org
|
16
|
-
raise "The connection is not ready. Please check by `sf org list`" unless org_info.connected?
|
17
|
-
|
18
15
|
conn = SfCli::Sf::Model::SfCommandConnection.new target_org: target_org, instance_url: org_info.instance_url
|
16
|
+
conn.open unless org_info.connected?
|
17
|
+
|
19
18
|
SfCli::Sf::Model.set_connection conn
|
20
19
|
|
21
20
|
available_models.each do |model|
|
@@ -58,11 +57,11 @@ module SfCli
|
|
58
57
|
alias :gen :generate
|
59
58
|
alias :conn :connection
|
60
59
|
|
61
|
-
def help
|
60
|
+
def help
|
62
61
|
conf.inspect_mode = false
|
63
62
|
puts <<~HELP
|
64
63
|
Available commands:
|
65
|
-
use --- set current org
|
64
|
+
use --- set current org.
|
66
65
|
gen --- generate Object model classes
|
67
66
|
query --- Query by SOQL with human readable format
|
68
67
|
apex --- run Apex code
|
@@ -73,14 +72,14 @@ module SfCli
|
|
73
72
|
use target-org
|
74
73
|
|
75
74
|
parameters:
|
76
|
-
targat-org --- Username or alias of the org you are going to use.
|
75
|
+
targat-org --- Username or alias of the org you are going to use. If you are not sure about them, check by `sf org list`.
|
77
76
|
|
78
77
|
[gen]
|
79
78
|
gen object-name, object-name, ...
|
80
79
|
generate object-name, object-name, ...
|
81
80
|
|
82
81
|
parameters:
|
83
|
-
object-name --- Comma separated Names. Symbol or String can be OK. At least 1 object name is required.
|
82
|
+
object-name --- Comma separated Names. Symbol or String can be OK. At least 1 object name is required.
|
84
83
|
|
85
84
|
example:
|
86
85
|
gen :Account, :Contact, :User
|
@@ -9,6 +9,7 @@ module SfCli
|
|
9
9
|
#
|
10
10
|
# @see https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm command reference
|
11
11
|
#
|
12
|
+
# @private :nodoc: just for developers
|
12
13
|
module Project
|
13
14
|
# @private :nodoc: just for developers
|
14
15
|
class Core
|